/**
 * Copyright (c) 2016 NumberFour AG.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   NumberFour AG - Initial API and implementation
 */
package org.eclipse.n4js.tests.parser;

import org.junit.Test;

public class YuiTest extends AbstractParserTest {

	@Test
	public void testAlignPluginCoverage() {
		parseESSuccessfully(
				"""
						if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }
						if (!__coverage__['build/align-plugin/align-plugin.js']) {
						   __coverage__['build/align-plugin/align-plugin.js'] = {"path":"build/align-plugin/align-plugin.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,0],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[0,0],"24":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":43}}},"2":{"name":"Align","line":20,"loc":{"start":{"line":20,"column":4},"end":{"line":20,"column":27}}},"3":{"name":"(anonymous_3)","line":58,"loc":{"start":{"line":58,"column":12},"end":{"line":58,"column":63}}},"4":{"name":"(anonymous_4)","line":103,"loc":{"start":{"line":103,"column":14},"end":{"line":103,"column":25}}},"5":{"name":"(anonymous_5)","line":108,"loc":{"start":{"line":108,"column":17},"end":{"line":108,"column":31}}},"6":{"name":"(anonymous_6)","line":118,"loc":{"start":{"line":118,"column":19},"end":{"line":118,"column":30}}},"7":{"name":"(anonymous_7)","line":120,"loc":{"start":{"line":120,"column":23},"end":{"line":120,"column":34}}},"8":{"name":"(anonymous_8)","line":133,"loc":{"start":{"line":133,"column":16},"end":{"line":133,"column":41}}},"9":{"name":"(anonymous_9)","line":143,"loc":{"start":{"line":143,"column":17},"end":{"line":143,"column":28}}},"10":{"name":"(anonymous_10)","line":152,"loc":{"start":{"line":152,"column":13},"end":{"line":152,"column":31}}},"11":{"name":"(anonymous_11)","line":156,"loc":{"start":{"line":156,"column":13},"end":{"line":156,"column":31}}},"12":{"name":"(anonymous_12)","line":160,"loc":{"start":{"line":160,"column":13},"end":{"line":160,"column":31}}},"13":{"name":"(anonymous_13)","line":164,"loc":{"start":{"line":164,"column":13},"end":{"line":164,"column":31}}},"14":{"name":"(anonymous_14)","line":168,"loc":{"start":{"line":168,"column":13},"end":{"line":168,"column":38}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":193,"column":63}},"2":{"start":{"line":9,"column":4},"end":{"line":11,"column":30}},"3":{"start":{"line":20,"column":4},"end":{"line":24,"column":5}},"4":{"start":{"line":21,"column":8},"end":{"line":23,"column":9}},"5":{"start":{"line":22,"column":12},"end":{"line":22,"column":37}},"6":{"start":{"line":26,"column":4},"end":{"line":149,"column":6}},"7":{"start":{"line":60,"column":12},"end":{"line":60,"column":48}},"8":{"start":{"line":62,"column":12},"end":{"line":64,"column":13}},"9":{"start":{"line":63,"column":16},"end":{"line":63,"column":53}},"10":{"start":{"line":66,"column":12},"end":{"line":99,"column":13}},"11":{"start":{"line":67,"column":16},"end":{"line":77,"column":89}},"12":{"start":{"line":79,"column":16},"end":{"line":81,"column":17}},"13":{"start":{"line":80,"column":20},"end":{"line":80,"column":59}},"14":{"start":{"line":82,"column":16},"end":{"line":84,"column":17}},"15":{"start":{"line":83,"column":20},"end":{"line":83,"column":59}},"16":{"start":{"line":86,"column":16},"end":{"line":88,"column":17}},"17":{"start":{"line":87,"column":20},"end":{"line":87,"column":53}},"18":{"start":{"line":89,"column":16},"end":{"line":91,"column":17}},"19":{"start":{"line":90,"column":20},"end":{"line":90,"column":53}},"20":{"start":{"line":93,"column":16},"end":{"line":95,"column":17}},"21":{"start":{"line":94,"column":20},"end":{"line":94,"column":35}},"22":{"start":{"line":97,"column":16},"end":{"line":97,"column":43}},"23":{"start":{"line":100,"column":12},"end":{"line":100,"column":24}},"24":{"start":{"line":104,"column":12},"end":{"line":104,"column":48}},"25":{"start":{"line":105,"column":12},"end":{"line":105,"column":24}},"26":{"start":{"line":109,"column":12},"end":{"line":109,"column":38}},"27":{"start":{"line":110,"column":12},"end":{"line":114,"column":13}},"28":{"start":{"line":111,"column":16},"end":{"line":111,"column":76}},"29":{"start":{"line":112,"column":19},"end":{"line":114,"column":13}},"30":{"start":{"line":113,"column":16},"end":{"line":113,"column":32}},"31":{"start":{"line":119,"column":12},"end":{"line":119,"column":28}},"32":{"start":{"line":120,"column":12},"end":{"line":122,"column":15}},"33":{"start":{"line":121,"column":16},"end":{"line":121,"column":28}},"34":{"start":{"line":134,"column":12},"end":{"line":134,"column":48}},"35":{"start":{"line":135,"column":12},"end":{"line":135,"column":24}},"36":{"start":{"line":144,"column":12},"end":{"line":144,"column":38}},"37":{"start":{"line":145,"column":12},"end":{"line":147,"column":13}},"38":{"start":{"line":146,"column":16},"end":{"line":146,"column":32}},"39":{"start":{"line":151,"column":4},"end":{"line":181,"column":6}},"40":{"start":{"line":153,"column":12},"end":{"line":153,"column":22}},"41":{"start":{"line":157,"column":12},"end":{"line":157,"column":43}},"42":{"start":{"line":161,"column":12},"end":{"line":161,"column":43}},"43":{"start":{"line":165,"column":12},"end":{"line":165,"column":22}},"44":{"start":{"line":169,"column":12},"end":{"line":170,"column":25}},"45":{"start":{"line":172,"column":12},"end":{"line":177,"column":13}},"46":{"start":{"line":173,"column":16},"end":{"line":173,"column":63}},"47":{"start":{"line":175,"column":16},"end":{"line":175,"column":47}},"48":{"start":{"line":176,"column":16},"end":{"line":176,"column":59}},"49":{"start":{"line":179,"column":13},"end":{"line":179,"column":24}},"50":{"start":{"line":183,"column":4},"end":{"line":183,"column":25}},"51":{"start":{"line":184,"column":4},"end":{"line":184,"column":23}},"52":{"start":{"line":186,"column":4},"end":{"line":186,"column":40}},"53":{"start":{"line":188,"column":4},"end":{"line":188,"column":26}},"54":{"start":{"line":189,"column":4},"end":{"line":189,"column":27}}},"branchMap":{"1":{"line":21,"type":"if","locations":[{"start":{"line":21,"column":8},"end":{"line":21,"column":8}},{"start":{"line":21,"column":8},"end":{"line":21,"column":8}}]},"2":{"line":62,"type":"if","locations":[{"start":{"line":62,"column":12},"end":{"line":62,"column":12}},{"start":{"line":62,"column":12},"end":{"line":62,"column":12}}]},"3":{"line":66,"type":"if","locations":[{"start":{"line":66,"column":12},"end":{"line":66,"column":12}},{"start":{"line":66,"column":12},"end":{"line":66,"column":12}}]},"4":{"line":74,"type":"cond-expr","locations":[{"start":{"line":74,"column":46},"end":{"line":74,"column":75}},{"start":{"line":74,"column":77},"end":{"line":74,"column":81}}]},"5":{"line":75,"type":"cond-expr","locations":[{"start":{"line":75,"column":72},"end":{"line":75,"column":101}},{"start":{"line":75,"column":104},"end":{"line":75,"column":108}}]},"6":{"line":75,"type":"binary-expr","locations":[{"start":{"line":75,"column":33},"end":{"line":75,"column":44}},{"start":{"line":75,"column":48},"end":{"line":75,"column":68}}]},"7":{"line":76,"type":"cond-expr","locations":[{"start":{"line":76,"column":38},"end":{"line":76,"column":61}},{"start":{"line":76,"column":64},"end":{"line":76,"column":68}}]},"8":{"line":77,"type":"cond-expr","locations":[{"start":{"line":77,"column":58},"end":{"line":77,"column":81}},{"start":{"line":77,"column":84},"end":{"line":77,"column":88}}]},"9":{"line":77,"type":"binary-expr","locations":[{"start":{"line":77,"column":31},"end":{"line":77,"column":36}},{"start":{"line":77,"column":40},"end":{"line":77,"column":54}}]},"10":{"line":79,"type":"if","locations":[{"start":{"line":79,"column":16},"end":{"line":79,"column":16}},{"start":{"line":79,"column":16},"end":{"line":79,"column":16}}]},"11":{"line":82,"type":"if","locations":[{"start":{"line":82,"column":16},"end":{"line":82,"column":16}},{"start":{"line":82,"column":16},"end":{"line":82,"column":16}}]},"12":{"line":86,"type":"if","locations":[{"start":{"line":86,"column":16},"end":{"line":86,"column":16}},{"start":{"line":86,"column":16},"end":{"line":86,"column":16}}]},"13":{"line":89,"type":"if","locations":[{"start":{"line":89,"column":16},"end":{"line":89,"column":16}},{"start":{"line":89,"column":16},"end":{"line":89,"column":16}}]},"14":{"line":93,"type":"if","locations":[{"start":{"line":93,"column":16},"end":{"line":93,"column":16}},{"start":{"line":93,"column":16},"end":{"line":93,"column":16}}]},"15":{"line":93,"type":"binary-expr","locations":[{"start":{"line":93,"column":20},"end":{"line":93,"column":22}},{"start":{"line":93,"column":26},"end":{"line":93,"column":30}}]},"16":{"line":110,"type":"if","locations":[{"start":{"line":110,"column":12},"end":{"line":110,"column":12}},{"start":{"line":110,"column":12},"end":{"line":110,"column":12}}]},"17":{"line":110,"type":"binary-expr","locations":[{"start":{"line":110,"column":16},"end":{"line":110,"column":19}},{"start":{"line":110,"column":23},"end":{"line":110,"column":30}}]},"18":{"line":112,"type":"if","locations":[{"start":{"line":112,"column":19},"end":{"line":112,"column":19}},{"start":{"line":112,"column":19},"end":{"line":112,"column":19}}]},"19":{"line":112,"type":"binary-expr","locations":[{"start":{"line":112,"column":23},"end":{"line":112,"column":27}},{"start":{"line":112,"column":31},"end":{"line":112,"column":37}}]},"20":{"line":145,"type":"if","locations":[{"start":{"line":145,"column":12},"end":{"line":145,"column":12}},{"start":{"line":145,"column":12},"end":{"line":145,"column":12}}]},"21":{"line":169,"type":"cond-expr","locations":[{"start":{"line":169,"column":65},"end":{"line":169,"column":66}},{"start":{"line":169,"column":69},"end":{"line":169,"column":70}}]},"22":{"line":169,"type":"binary-expr","locations":[{"start":{"line":169,"column":24},"end":{"line":169,"column":40}},{"start":{"line":169,"column":44},"end":{"line":169,"column":60}}]},"23":{"line":172,"type":"if","locations":[{"start":{"line":172,"column":12},"end":{"line":172,"column":12}},{"start":{"line":172,"column":12},"end":{"line":172,"column":12}}]},"24":{"line":176,"type":"cond-expr","locations":[{"start":{"line":176,"column":31},"end":{"line":176,"column":43}},{"start":{"line":176,"column":46},"end":{"line":176,"column":58}}]}},"code":["(function () { YUI.add('align-plugin', function (Y, NAME) {","","    /**","     * Provides advanced positioning support for Node via a Plugin","     * for centering and alignment. ","     * @module align-plugin","     */","","    var OFFSET_WIDTH = 'offsetWidth',","        OFFSET_HEIGHT = 'offsetHeight',","        undefined = undefined;","","    /**","     * Node plugin which can be used to align a node with another node,","     * region, or the viewport.","     *","     * @class Plugin.Align","     * @param {Object} User configuration object","     */","    function Align(config) {","        if (config.host) {","            this._host = config.host;","        }","    }","        ","    Align.prototype = {","        /**","         * Aligns node with a point on another node or region.","         * Possible alignment points are:","         * <dl>","         *      <dt>tl</dt>","         *      <dd>top left</dd>","         *      <dt>tr</dt>","         *      <dd>top right</dd>","         *      <dt>bl</dt>","         *      <dd>bottom left</dd>","         *      <dt>br</dt>","         *      <dd>bottom right</dd>","         *      <dt>tc</dt>","         *      <dd>top center</dd>","         *      <dt>bc</dt>","         *      <dd>bottom center</dd>","         *      <dt>rc</dt>","         *      <dd>right center</dd>","         *      <dt>lc</dt>","         *      <dd>left center</dd>","         *      <dt>cc</dt>","         *      <dd>center center</dd>","         * </dl>","         * @method to ","         * @param region {String || Node || HTMLElement || Object} The node or","         * region to align with. Defaults to the viewport region.","         * @param regionPoint {String} The point of the region to align with.","         * @param point {String} The point of the node aligned to the region. ","         * @param resize {Boolean} Whether or not the node should re-align when","         * the window is resized. Defaults to false.","         */","        to: function(region, regionPoint, point, syncOnResize) {","            // cache original args for syncing","            this._syncArgs = Y.Array(arguments);","","            if (region.top === undefined) {","                region = Y.one(region).get('region');","            }","","            if (region) {","                var xy = [region.left, region.top],","                    offxy = [region.width, region.height],","                    points = Align.points,","                    node = this._host,","                    NULL = null,","                    size = node.getAttrs([OFFSET_HEIGHT, OFFSET_WIDTH]),","                    nodeoff = [0 - size[OFFSET_WIDTH], 0 - size[OFFSET_HEIGHT]], // reverse offsets","                    regionFn0 = regionPoint ? points[regionPoint.charAt(0)]: NULL,","                    regionFn1 = (regionPoint && regionPoint !== 'cc') ? points[regionPoint.charAt(1)] : NULL,","                    nodeFn0 = point ? points[point.charAt(0)] : NULL,","                    nodeFn1 = (point && point !== 'cc') ? points[point.charAt(1)] : NULL;","","                if (regionFn0) {","                    xy = regionFn0(xy, offxy, regionPoint);","                }","                if (regionFn1) {","                    xy = regionFn1(xy, offxy, regionPoint);","                }","","                if (nodeFn0) {","                    xy = nodeFn0(xy, nodeoff, point);","                }","                if (nodeFn1) {","                    xy = nodeFn1(xy, nodeoff, point);","                }","","                if (xy && node) {","                    node.setXY(xy);","                }","                ","                this._resize(syncOnResize);","","            }","            return this;","        },","","        sync: function() {","            this.to.apply(this, this._syncArgs);","            return this;","        },","","        _resize: function(add) {","            var handle = this._handle;","            if (add && !handle) {","                this._handle = Y.on('resize', this._onresize, window, this);","            } else if (!add && handle) {","                handle.detach();","            }","","        },","","        _onresize: function() {","            var self = this;","            setTimeout(function() { // for performance","                self.sync();","            });","        },","    ","        /**","         * Aligns the center of a node to the center of another node or region.","         * @method center ","         * @param region {Node || HTMLElement || Object} optional The node or","         * region to align with. Defaults to the viewport region.","         * the window is resized. If centering to viewport, this defaults","         * to true, otherwise default is false.","         */","        center: function(region, resize) {","            this.to(region, 'cc', 'cc', resize); ","            return this;","        },","","        /**","         * Removes the resize handler, if any. This is called automatically","         * when unplugged from the host node.","         * @method destroy ","         */","        destroy: function() {","            var handle = this._handle;","            if (handle) {","                handle.detach();","            }","        }","    };","","    Align.points = {","        't': function(xy, off) {","            return xy;","        },","","        'r': function(xy, off) {","            return [xy[0] + off[0], xy[1]];","        },","","        'b': function(xy, off) {","            return [xy[0], xy[1] + off[1]];","        },","","        'l': function(xy, off) {","            return xy;","        },","","        'c': function(xy, off, point) {","            var axis = (point[0] === 't' || point[0] === 'b') ?  0 : 1,","                ret, val;","","            if (point === 'cc') {","                ret = [xy[0] + off[0] / 2, xy[1] + off[1] / 2];","            } else {","                val = xy[axis] + off[axis] / 2;","                ret = (axis) ? [xy[0], val] : [val, xy[1]];","            }","","             return ret;","        }","    };","","    Align.NAME = 'Align';","    Align.NS = 'align';","","    Align.prototype.constructor = Align;","","    Y.namespace('Plugin');","    Y.Plugin.Align = Align;","","","","}, '3.12.0', {\\"requires\\": [\\"node-screen\\", \\"node-pluginhost\\"]});","","}());"]};
						}
						var __cov_R9lh3EQUN7v9Y4Y8KNqxug = __coverage__['build/align-plugin/align-plugin.js'];
						__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['1']++;YUI.add('align-plugin',function(Y,NAME){__cov_R9lh3EQUN7v9Y4Y8KNqxug.f['1']++;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['2']++;var OFFSET_WIDTH='offsetWidth',OFFSET_HEIGHT='offsetHeight',undefined=undefined;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['3']++;function Align(config){__cov_R9lh3EQUN7v9Y4Y8KNqxug.f['2']++;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['4']++;if(config.host){__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['1'][0]++;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['5']++;this._host=config.host;}else{__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['1'][1]++;}}__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['6']++;Align.prototype={to:function(region,regionPoint,point,syncOnResize){__cov_R9lh3EQUN7v9Y4Y8KNqxug.f['3']++;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['7']++;this._syncArgs=Y.Array(arguments);__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['8']++;if(region.top===undefined){__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['2'][0]++;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['9']++;region=Y.one(region).get('region');}else{__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['2'][1]++;}__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['10']++;if(region){__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['3'][0]++;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['11']++;var xy=[region.left,region.top],offxy=[region.width,region.height],points=Align.points,node=this._host,NULL=null,size=node.getAttrs([OFFSET_HEIGHT,OFFSET_WIDTH]),nodeoff=[0-size[OFFSET_WIDTH],0-size[OFFSET_HEIGHT]],regionFn0=regionPoint?(__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['4'][0]++,points[regionPoint.charAt(0)]):(__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['4'][1]++,NULL),regionFn1=(__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['6'][0]++,regionPoint)&&(__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['6'][1]++,regionPoint!=='cc')?(__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['5'][0]++,points[regionPoint.charAt(1)]):(__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['5'][1]++,NULL),nodeFn0=point?(__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['7'][0]++,points[point.charAt(0)]):(__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['7'][1]++,NULL),nodeFn1=(__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['9'][0]++,point)&&(__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['9'][1]++,point!=='cc')?(__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['8'][0]++,points[point.charAt(1)]):(__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['8'][1]++,NULL);__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['12']++;if(regionFn0){__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['10'][0]++;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['13']++;xy=regionFn0(xy,offxy,regionPoint);}else{__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['10'][1]++;}__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['14']++;if(regionFn1){__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['11'][0]++;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['15']++;xy=regionFn1(xy,offxy,regionPoint);}else{__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['11'][1]++;}__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['16']++;if(nodeFn0){__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['12'][0]++;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['17']++;xy=nodeFn0(xy,nodeoff,point);}else{__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['12'][1]++;}__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['18']++;if(nodeFn1){__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['13'][0]++;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['19']++;xy=nodeFn1(xy,nodeoff,point);}else{__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['13'][1]++;}__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['20']++;if((__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['15'][0]++,xy)&&(__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['15'][1]++,node)){__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['14'][0]++;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['21']++;node.setXY(xy);}else{__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['14'][1]++;}__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['22']++;this._resize(syncOnResize);}else{__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['3'][1]++;}__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['23']++;return this;},sync:function(){__cov_R9lh3EQUN7v9Y4Y8KNqxug.f['4']++;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['24']++;this.to.apply(this,this._syncArgs);__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['25']++;return this;},_resize:function(add){__cov_R9lh3EQUN7v9Y4Y8KNqxug.f['5']++;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['26']++;var handle=this._handle;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['27']++;if((__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['17'][0]++,add)&&(__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['17'][1]++,!handle)){__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['16'][0]++;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['28']++;this._handle=Y.on('resize',this._onresize,window,this);}else{__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['16'][1]++;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['29']++;if((__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['19'][0]++,!add)&&(__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['19'][1]++,handle)){__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['18'][0]++;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['30']++;handle.detach();}else{__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['18'][1]++;}}},_onresize:function(){__cov_R9lh3EQUN7v9Y4Y8KNqxug.f['6']++;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['31']++;var self=this;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['32']++;setTimeout(function(){__cov_R9lh3EQUN7v9Y4Y8KNqxug.f['7']++;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['33']++;self.sync();});},center:function(region,resize){__cov_R9lh3EQUN7v9Y4Y8KNqxug.f['8']++;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['34']++;this.to(region,'cc','cc',resize);__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['35']++;return this;},destroy:function(){__cov_R9lh3EQUN7v9Y4Y8KNqxug.f['9']++;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['36']++;var handle=this._handle;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['37']++;if(handle){__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['20'][0]++;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['38']++;handle.detach();}else{__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['20'][1]++;}}};__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['39']++;Align.points={'t':function(xy,off){__cov_R9lh3EQUN7v9Y4Y8KNqxug.f['10']++;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['40']++;return xy;},'r':function(xy,off){__cov_R9lh3EQUN7v9Y4Y8KNqxug.f['11']++;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['41']++;return[xy[0]+off[0],xy[1]];},'b':function(xy,off){__cov_R9lh3EQUN7v9Y4Y8KNqxug.f['12']++;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['42']++;return[xy[0],xy[1]+off[1]];},'l':function(xy,off){__cov_R9lh3EQUN7v9Y4Y8KNqxug.f['13']++;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['43']++;return xy;},'c':function(xy,off,point){__cov_R9lh3EQUN7v9Y4Y8KNqxug.f['14']++;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['44']++;var axis=(__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['22'][0]++,point[0]==='t')||(__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['22'][1]++,point[0]==='b')?(__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['21'][0]++,0):(__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['21'][1]++,1),ret,val;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['45']++;if(point==='cc'){__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['23'][0]++;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['46']++;ret=[xy[0]+off[0]/2,xy[1]+off[1]/2];}else{__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['23'][1]++;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['47']++;val=xy[axis]+off[axis]/2;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['48']++;ret=axis?(__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['24'][0]++,[xy[0],val]):(__cov_R9lh3EQUN7v9Y4Y8KNqxug.b['24'][1]++,[val,xy[1]]);}__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['49']++;return ret;}};__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['50']++;Align.NAME='Align';__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['51']++;Align.NS='align';__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['52']++;Align.prototype.constructor=Align;__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['53']++;Y.namespace('Plugin');__cov_R9lh3EQUN7v9Y4Y8KNqxug.s['54']++;Y.Plugin.Align=Align;},'3.12.0',{'requires':['node-screen','node-pluginhost']});
						""");
	}

	@Test
	public void testAlignPluginMin() {
		parseESSuccessfully(
				"""
						YUI.add("align-plugin",function(e,t){function s(e){e.host&&(this._host=e.host)}var n="offsetWidth",r="offsetHeight",i=i;s.prototype={to:function(t,o,u,a){this._syncArgs=e.Array(arguments),t.top===i&&(t=e.one(t).get("region"));if(t){var f=[t.left,t.top],l=[t.width,t.height],c=s.points,h=this._host,p=null,d=h.getAttrs([r,n]),v=[0-d[n],0-d[r]],m=o?c[o.charAt(0)]:p,g=o&&o!=="cc"?c[o.charAt(1)]:p,y=u?c[u.charAt(0)]:p,b=u&&u!=="cc"?c[u.charAt(1)]:p;m&&(f=m(f,l,o)),g&&(f=g(f,l,o)),y&&(f=y(f,v,u)),b&&(f=b(f,v,u)),f&&h&&h.setXY(f),this._resize(a)}return this},sync:function(){return this.to.apply(this,this._syncArgs),this},_resize:function(t){var n=this._handle;t&&!n?this._handle=e.on("resize",this._onresize,window,this):!t&&n&&n.detach()},_onresize:function(){var e=this;setTimeout(function(){e.sync()})},center:function(e,t){return this.to(e,"cc","cc",t),this},destroy:function(){var e=this._handle;e&&e.detach()}},s.points={t:function(e,t){return e},r:function(e,t){return[e[0]+t[0],e[1]]},b:function(e,t){return[e[0],e[1]+t[1]]},l:function(e,t){return e},c:function(e,t,n){var r=n[0]==="t"||n[0]==="b"?0:1,i,s;return n==="cc"?i=[e[0]+t[0]/2,e[1]+t[1]/2]:(s=e[r]+t[r]/2,i=r?[e[0],s]:[s,e[1]]),i}},s.NAME="Align",s.NS="align",s.prototype.constructor=s,e.namespace("Plugin"),e.Plugin.Align=s},"3.12.0",{requires:["node-screen","node-pluginhost"]});
						""");
	}

	@Test
	public void testAppBaseCoverage() {
		parseESSuccessfully(
				"""
						if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }
						if (!__coverage__['build/app-base/app-base.js']) {
						   __coverage__['build/app-base/app-base.js'] = {"path":"build/app-base/app-base.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0,"107":0,"108":0,"109":0,"110":0,"111":0,"112":0,"113":0,"114":0,"115":0,"116":0,"117":0,"118":0,"119":0,"120":0,"121":0,"122":0,"123":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,0,0],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0],"23":[0,0],"24":[0,0],"25":[0,0],"26":[0,0],"27":[0,0],"28":[0,0],"29":[0,0],"30":[0,0],"31":[0,0],"32":[0,0],"33":[0,0],"34":[0,0],"35":[0,0],"36":[0,0],"37":[0,0],"38":[0,0],"39":[0,0],"40":[0,0],"41":[0,0],"42":[0,0],"43":[0,0],"44":[0,0],"45":[0,0],"46":[0,0],"47":[0,0],"48":[0,0],"49":[0,0],"50":[0,0],"51":[0,0],"52":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":39}}},"2":{"name":"(anonymous_2)","line":150,"loc":{"start":{"line":150,"column":17},"end":{"line":150,"column":35}}},"3":{"name":"mergeViewConfig","line":156,"loc":{"start":{"line":156,"column":8},"end":{"line":156,"column":45}}},"4":{"name":"(anonymous_4)","line":201,"loc":{"start":{"line":201,"column":16},"end":{"line":201,"column":40}}},"5":{"name":"(anonymous_5)","line":228,"loc":{"start":{"line":228,"column":17},"end":{"line":228,"column":33}}},"6":{"name":"(anonymous_6)","line":285,"loc":{"start":{"line":285,"column":12},"end":{"line":285,"column":24}}},"7":{"name":"(anonymous_7)","line":375,"loc":{"start":{"line":375,"column":14},"end":{"line":375,"column":57}}},"8":{"name":"(anonymous_8)","line":448,"loc":{"start":{"line":448,"column":17},"end":{"line":448,"column":42}}},"9":{"name":"(anonymous_9)","line":482,"loc":{"start":{"line":482,"column":23},"end":{"line":482,"column":35}}},"10":{"name":"(anonymous_10)","line":527,"loc":{"start":{"line":527,"column":17},"end":{"line":527,"column":33}}},"11":{"name":"(anonymous_11)","line":566,"loc":{"start":{"line":566,"column":23},"end":{"line":566,"column":40}}},"12":{"name":"(anonymous_12)","line":597,"loc":{"start":{"line":597,"column":16},"end":{"line":597,"column":28}}},"13":{"name":"(anonymous_13)","line":623,"loc":{"start":{"line":623,"column":18},"end":{"line":623,"column":42}}},"14":{"name":"(anonymous_14)","line":649,"loc":{"start":{"line":649,"column":19},"end":{"line":649,"column":42}}},"15":{"name":"(anonymous_15)","line":679,"loc":{"start":{"line":679,"column":15},"end":{"line":679,"column":39}}},"16":{"name":"(anonymous_16)","line":712,"loc":{"start":{"line":712,"column":11},"end":{"line":712,"column":35}}},"17":{"name":"(anonymous_17)","line":779,"loc":{"start":{"line":779,"column":22},"end":{"line":779,"column":59}}},"18":{"name":"(anonymous_18)","line":816,"loc":{"start":{"line":816,"column":28},"end":{"line":816,"column":41}}},"19":{"name":"(anonymous_19)","line":869,"loc":{"start":{"line":869,"column":21},"end":{"line":869,"column":33}}},"20":{"name":"(anonymous_20)","line":985,"loc":{"start":{"line":985,"column":23},"end":{"line":985,"column":35}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1098,"column":80}},"2":{"start":{"line":40,"column":0},"end":{"line":51,"column":12}},"3":{"start":{"line":75,"column":0},"end":{"line":1033,"column":3}},"4":{"start":{"line":151,"column":8},"end":{"line":151,"column":32}},"5":{"start":{"line":153,"column":8},"end":{"line":153,"column":23}},"6":{"start":{"line":156,"column":8},"end":{"line":158,"column":9}},"7":{"start":{"line":157,"column":12},"end":{"line":157,"column":53}},"8":{"start":{"line":162,"column":8},"end":{"line":162,"column":50}},"9":{"start":{"line":166,"column":8},"end":{"line":166,"column":52}},"10":{"start":{"line":170,"column":8},"end":{"line":170,"column":34}},"11":{"start":{"line":171,"column":8},"end":{"line":171,"column":31}},"12":{"start":{"line":174,"column":8},"end":{"line":174,"column":79}},"13":{"start":{"line":178,"column":8},"end":{"line":180,"column":9}},"14":{"start":{"line":179,"column":12},"end":{"line":179,"column":31}},"15":{"start":{"line":202,"column":8},"end":{"line":204,"column":34}},"16":{"start":{"line":207,"column":8},"end":{"line":208,"column":60}},"17":{"start":{"line":211,"column":8},"end":{"line":211,"column":43}},"18":{"start":{"line":212,"column":8},"end":{"line":212,"column":58}},"19":{"start":{"line":214,"column":8},"end":{"line":214,"column":20}},"20":{"start":{"line":229,"column":8},"end":{"line":231,"column":9}},"21":{"start":{"line":230,"column":12},"end":{"line":230,"column":36}},"22":{"start":{"line":233,"column":8},"end":{"line":233,"column":62}},"23":{"start":{"line":286,"column":8},"end":{"line":291,"column":69}},"24":{"start":{"line":293,"column":8},"end":{"line":293,"column":44}},"25":{"start":{"line":294,"column":8},"end":{"line":294,"column":50}},"26":{"start":{"line":297,"column":8},"end":{"line":299,"column":9}},"27":{"start":{"line":298,"column":12},"end":{"line":298,"column":59}},"28":{"start":{"line":302,"column":8},"end":{"line":304,"column":9}},"29":{"start":{"line":303,"column":12},"end":{"line":303,"column":49}},"30":{"start":{"line":306,"column":8},"end":{"line":306,"column":20}},"31":{"start":{"line":376,"column":8},"end":{"line":376,"column":30}},"32":{"start":{"line":378,"column":8},"end":{"line":378,"column":34}},"33":{"start":{"line":381,"column":8},"end":{"line":385,"column":9}},"34":{"start":{"line":382,"column":12},"end":{"line":382,"column":61}},"35":{"start":{"line":383,"column":15},"end":{"line":385,"column":9}},"36":{"start":{"line":384,"column":12},"end":{"line":384,"column":42}},"37":{"start":{"line":387,"column":8},"end":{"line":409,"column":9}},"38":{"start":{"line":388,"column":12},"end":{"line":388,"column":46}},"39":{"start":{"line":394,"column":12},"end":{"line":408,"column":13}},"40":{"start":{"line":395,"column":16},"end":{"line":395,"column":41}},"41":{"start":{"line":398,"column":16},"end":{"line":398,"column":66}},"42":{"start":{"line":406,"column":16},"end":{"line":406,"column":56}},"43":{"start":{"line":407,"column":16},"end":{"line":407,"column":31}},"44":{"start":{"line":413,"column":8},"end":{"line":415,"column":9}},"45":{"start":{"line":414,"column":12},"end":{"line":414,"column":34}},"46":{"start":{"line":423,"column":8},"end":{"line":429,"column":9}},"47":{"start":{"line":424,"column":12},"end":{"line":426,"column":13}},"48":{"start":{"line":425,"column":16},"end":{"line":425,"column":30}},"49":{"start":{"line":427,"column":15},"end":{"line":429,"column":9}},"50":{"start":{"line":428,"column":12},"end":{"line":428,"column":26}},"51":{"start":{"line":431,"column":8},"end":{"line":431,"column":65}},"52":{"start":{"line":449,"column":8},"end":{"line":451,"column":9}},"53":{"start":{"line":450,"column":12},"end":{"line":450,"column":19}},"54":{"start":{"line":453,"column":8},"end":{"line":454,"column":54}},"55":{"start":{"line":457,"column":8},"end":{"line":457,"column":29}},"56":{"start":{"line":460,"column":8},"end":{"line":462,"column":9}},"57":{"start":{"line":461,"column":12},"end":{"line":461,"column":37}},"58":{"start":{"line":471,"column":8},"end":{"line":471,"column":77}},"59":{"start":{"line":483,"column":8},"end":{"line":486,"column":63}},"60":{"start":{"line":489,"column":8},"end":{"line":505,"column":9}},"61":{"start":{"line":491,"column":12},"end":{"line":491,"column":32}},"62":{"start":{"line":494,"column":12},"end":{"line":494,"column":51}},"63":{"start":{"line":496,"column":12},"end":{"line":502,"column":13}},"64":{"start":{"line":498,"column":16},"end":{"line":498,"column":57}},"65":{"start":{"line":501,"column":16},"end":{"line":501,"column":43}},"66":{"start":{"line":504,"column":12},"end":{"line":504,"column":19}},"67":{"start":{"line":509,"column":8},"end":{"line":509,"column":35}},"68":{"start":{"line":511,"column":8},"end":{"line":513,"column":9}},"69":{"start":{"line":512,"column":12},"end":{"line":512,"column":35}},"70":{"start":{"line":528,"column":8},"end":{"line":530,"column":9}},"71":{"start":{"line":529,"column":12},"end":{"line":529,"column":19}},"72":{"start":{"line":532,"column":8},"end":{"line":532,"column":52}},"73":{"start":{"line":534,"column":8},"end":{"line":552,"column":9}},"74":{"start":{"line":535,"column":12},"end":{"line":535,"column":26}},"75":{"start":{"line":540,"column":12},"end":{"line":540,"column":41}},"76":{"start":{"line":546,"column":12},"end":{"line":546,"column":58}},"77":{"start":{"line":549,"column":12},"end":{"line":551,"column":13}},"78":{"start":{"line":550,"column":16},"end":{"line":550,"column":41}},"79":{"start":{"line":554,"column":8},"end":{"line":554,"column":32}},"80":{"start":{"line":571,"column":8},"end":{"line":577,"column":9}},"81":{"start":{"line":575,"column":12},"end":{"line":575,"column":56}},"82":{"start":{"line":576,"column":12},"end":{"line":576,"column":46}},"83":{"start":{"line":579,"column":8},"end":{"line":579,"column":21}},"84":{"start":{"line":600,"column":8},"end":{"line":602,"column":9}},"85":{"start":{"line":601,"column":12},"end":{"line":601,"column":25}},"86":{"start":{"line":605,"column":8},"end":{"line":605,"column":28}},"87":{"start":{"line":624,"column":8},"end":{"line":625,"column":50}},"88":{"start":{"line":627,"column":8},"end":{"line":629,"column":9}},"89":{"start":{"line":628,"column":12},"end":{"line":628,"column":68}},"90":{"start":{"line":631,"column":8},"end":{"line":631,"column":21}},"91":{"start":{"line":650,"column":8},"end":{"line":651,"column":48}},"92":{"start":{"line":653,"column":8},"end":{"line":655,"column":9}},"93":{"start":{"line":654,"column":12},"end":{"line":654,"column":67}},"94":{"start":{"line":657,"column":8},"end":{"line":657,"column":21}},"95":{"start":{"line":680,"column":8},"end":{"line":685,"column":9}},"96":{"start":{"line":684,"column":12},"end":{"line":684,"column":54}},"97":{"start":{"line":687,"column":8},"end":{"line":687,"column":69}},"98":{"start":{"line":713,"column":8},"end":{"line":713,"column":17}},"99":{"start":{"line":717,"column":8},"end":{"line":738,"column":9}},"100":{"start":{"line":719,"column":12},"end":{"line":722,"column":13}},"101":{"start":{"line":720,"column":16},"end":{"line":720,"column":102}},"102":{"start":{"line":721,"column":16},"end":{"line":721,"column":28}},"103":{"start":{"line":726,"column":12},"end":{"line":735,"column":13}},"104":{"start":{"line":728,"column":16},"end":{"line":728,"column":48}},"105":{"start":{"line":730,"column":16},"end":{"line":734,"column":17}},"106":{"start":{"line":731,"column":20},"end":{"line":731,"column":47}},"107":{"start":{"line":733,"column":20},"end":{"line":733,"column":40}},"108":{"start":{"line":737,"column":12},"end":{"line":737,"column":24}},"109":{"start":{"line":740,"column":8},"end":{"line":740,"column":61}},"110":{"start":{"line":780,"column":8},"end":{"line":780,"column":34}},"111":{"start":{"line":782,"column":8},"end":{"line":785,"column":53}},"112":{"start":{"line":789,"column":8},"end":{"line":791,"column":9}},"113":{"start":{"line":790,"column":12},"end":{"line":790,"column":60}},"114":{"start":{"line":793,"column":8},"end":{"line":793,"column":43}},"115":{"start":{"line":794,"column":8},"end":{"line":794,"column":34}},"116":{"start":{"line":796,"column":8},"end":{"line":798,"column":9}},"117":{"start":{"line":797,"column":12},"end":{"line":797,"column":41}},"118":{"start":{"line":817,"column":8},"end":{"line":817,"column":62}},"119":{"start":{"line":870,"column":16},"end":{"line":870,"column":37}},"120":{"start":{"line":985,"column":37},"end":{"line":985,"column":64}},"121":{"start":{"line":1036,"column":0},"end":{"line":1036,"column":34}},"122":{"start":{"line":1071,"column":0},"end":{"line":1071,"column":62}},"123":{"start":{"line":1082,"column":0},"end":{"line":1085,"column":2}}},"branchMap":{"1":{"line":151,"type":"binary-expr","locations":[{"start":{"line":151,"column":8},"end":{"line":151,"column":14}},{"start":{"line":151,"column":19},"end":{"line":151,"column":30}}]},"2":{"line":178,"type":"if","locations":[{"start":{"line":178,"column":8},"end":{"line":178,"column":8}},{"start":{"line":178,"column":8},"end":{"line":178,"column":8}}]},"3":{"line":203,"type":"binary-expr","locations":[{"start":{"line":203,"column":24},"end":{"line":203,"column":32}},{"start":{"line":203,"column":36},"end":{"line":203,"column":49}},{"start":{"line":203,"column":54},"end":{"line":203,"column":58}}]},"4":{"line":207,"type":"cond-expr","locations":[{"start":{"line":208,"column":16},"end":{"line":208,"column":52}},{"start":{"line":208,"column":55},"end":{"line":208,"column":59}}]},"5":{"line":229,"type":"if","locations":[{"start":{"line":229,"column":8},"end":{"line":229,"column":8}},{"start":{"line":229,"column":8},"end":{"line":229,"column":8}}]},"6":{"line":233,"type":"binary-expr","locations":[{"start":{"line":233,"column":15},"end":{"line":233,"column":19}},{"start":{"line":233,"column":23},"end":{"line":233,"column":61}}]},"7":{"line":290,"type":"binary-expr","locations":[{"start":{"line":290,"column":34},"end":{"line":290,"column":44}},{"start":{"line":290,"column":48},"end":{"line":290,"column":75}}]},"8":{"line":297,"type":"if","locations":[{"start":{"line":297,"column":8},"end":{"line":297,"column":8}},{"start":{"line":297,"column":8},"end":{"line":297,"column":8}}]},"9":{"line":297,"type":"binary-expr","locations":[{"start":{"line":297,"column":12},"end":{"line":297,"column":22}},{"start":{"line":297,"column":26},"end":{"line":297,"column":70}}]},"10":{"line":302,"type":"if","locations":[{"start":{"line":302,"column":8},"end":{"line":302,"column":8}},{"start":{"line":302,"column":8},"end":{"line":302,"column":8}}]},"11":{"line":302,"type":"binary-expr","locations":[{"start":{"line":302,"column":12},"end":{"line":302,"column":46}},{"start":{"line":302,"column":50},"end":{"line":302,"column":58}}]},"12":{"line":378,"type":"binary-expr","locations":[{"start":{"line":378,"column":8},"end":{"line":378,"column":15}},{"start":{"line":378,"column":20},"end":{"line":378,"column":32}}]},"13":{"line":381,"type":"if","locations":[{"start":{"line":381,"column":8},"end":{"line":381,"column":8}},{"start":{"line":381,"column":8},"end":{"line":381,"column":8}}]},"14":{"line":383,"type":"if","locations":[{"start":{"line":383,"column":15},"end":{"line":383,"column":15}},{"start":{"line":383,"column":15},"end":{"line":383,"column":15}}]},"15":{"line":387,"type":"if","locations":[{"start":{"line":387,"column":8},"end":{"line":387,"column":8}},{"start":{"line":387,"column":8},"end":{"line":387,"column":8}}]},"16":{"line":394,"type":"if","locations":[{"start":{"line":394,"column":12},"end":{"line":394,"column":12}},{"start":{"line":394,"column":12},"end":{"line":394,"column":12}}]},"17":{"line":394,"type":"binary-expr","locations":[{"start":{"line":394,"column":16},"end":{"line":394,"column":24}},{"start":{"line":394,"column":28},"end":{"line":394,"column":45}},{"start":{"line":394,"column":49},"end":{"line":394,"column":66}}]},"18":{"line":413,"type":"if","locations":[{"start":{"line":413,"column":8},"end":{"line":413,"column":8}},{"start":{"line":413,"column":8},"end":{"line":413,"column":8}}]},"19":{"line":413,"type":"binary-expr","locations":[{"start":{"line":413,"column":12},"end":{"line":413,"column":26}},{"start":{"line":413,"column":30},"end":{"line":413,"column":38}}]},"20":{"line":423,"type":"if","locations":[{"start":{"line":423,"column":8},"end":{"line":423,"column":8}},{"start":{"line":423,"column":8},"end":{"line":423,"column":8}}]},"21":{"line":424,"type":"if","locations":[{"start":{"line":424,"column":12},"end":{"line":424,"column":12}},{"start":{"line":424,"column":12},"end":{"line":424,"column":12}}]},"22":{"line":427,"type":"if","locations":[{"start":{"line":427,"column":15},"end":{"line":427,"column":15}},{"start":{"line":427,"column":15},"end":{"line":427,"column":15}}]},"23":{"line":449,"type":"if","locations":[{"start":{"line":449,"column":8},"end":{"line":449,"column":8}},{"start":{"line":449,"column":8},"end":{"line":449,"column":8}}]},"24":{"line":460,"type":"if","locations":[{"start":{"line":460,"column":8},"end":{"line":460,"column":8}},{"start":{"line":460,"column":8},"end":{"line":460,"column":8}}]},"25":{"line":471,"type":"cond-expr","locations":[{"start":{"line":471,"column":32},"end":{"line":471,"column":41}},{"start":{"line":471,"column":44},"end":{"line":471,"column":52}}]},"26":{"line":489,"type":"if","locations":[{"start":{"line":489,"column":8},"end":{"line":489,"column":8}},{"start":{"line":489,"column":8},"end":{"line":489,"column":8}}]},"27":{"line":496,"type":"if","locations":[{"start":{"line":496,"column":12},"end":{"line":496,"column":12}},{"start":{"line":496,"column":12},"end":{"line":496,"column":12}}]},"28":{"line":511,"type":"if","locations":[{"start":{"line":511,"column":8},"end":{"line":511,"column":8}},{"start":{"line":511,"column":8},"end":{"line":511,"column":8}}]},"29":{"line":528,"type":"if","locations":[{"start":{"line":528,"column":8},"end":{"line":528,"column":8}},{"start":{"line":528,"column":8},"end":{"line":528,"column":8}}]},"30":{"line":532,"type":"binary-expr","locations":[{"start":{"line":532,"column":23},"end":{"line":532,"column":45}},{"start":{"line":532,"column":49},"end":{"line":532,"column":51}}]},"31":{"line":534,"type":"if","locations":[{"start":{"line":534,"column":8},"end":{"line":534,"column":8}},{"start":{"line":534,"column":8},"end":{"line":534,"column":8}}]},"32":{"line":549,"type":"if","locations":[{"start":{"line":549,"column":12},"end":{"line":549,"column":12}},{"start":{"line":549,"column":12},"end":{"line":549,"column":12}}]},"33":{"line":571,"type":"if","locations":[{"start":{"line":571,"column":8},"end":{"line":571,"column":8}},{"start":{"line":571,"column":8},"end":{"line":571,"column":8}}]},"34":{"line":571,"type":"binary-expr","locations":[{"start":{"line":571,"column":12},"end":{"line":571,"column":18}},{"start":{"line":571,"column":22},"end":{"line":571,"column":42}}]},"35":{"line":600,"type":"if","locations":[{"start":{"line":600,"column":8},"end":{"line":600,"column":8}},{"start":{"line":600,"column":8},"end":{"line":600,"column":8}}]},"36":{"line":627,"type":"if","locations":[{"start":{"line":627,"column":8},"end":{"line":627,"column":8}},{"start":{"line":627,"column":8},"end":{"line":627,"column":8}}]},"37":{"line":627,"type":"binary-expr","locations":[{"start":{"line":627,"column":12},"end":{"line":627,"column":20}},{"start":{"line":627,"column":24},"end":{"line":627,"column":34}}]},"38":{"line":653,"type":"if","locations":[{"start":{"line":653,"column":8},"end":{"line":653,"column":8}},{"start":{"line":653,"column":8},"end":{"line":653,"column":8}}]},"39":{"line":653,"type":"binary-expr","locations":[{"start":{"line":653,"column":12},"end":{"line":653,"column":20}},{"start":{"line":653,"column":24},"end":{"line":653,"column":33}}]},"40":{"line":680,"type":"if","locations":[{"start":{"line":680,"column":8},"end":{"line":680,"column":8}},{"start":{"line":680,"column":8},"end":{"line":680,"column":8}}]},"41":{"line":717,"type":"if","locations":[{"start":{"line":717,"column":8},"end":{"line":717,"column":8}},{"start":{"line":717,"column":8},"end":{"line":717,"column":8}}]},"42":{"line":717,"type":"binary-expr","locations":[{"start":{"line":717,"column":12},"end":{"line":717,"column":37}},{"start":{"line":717,"column":41},"end":{"line":717,"column":59}}]},"43":{"line":719,"type":"if","locations":[{"start":{"line":719,"column":12},"end":{"line":719,"column":12}},{"start":{"line":719,"column":12},"end":{"line":719,"column":12}}]},"44":{"line":726,"type":"if","locations":[{"start":{"line":726,"column":12},"end":{"line":726,"column":12}},{"start":{"line":726,"column":12},"end":{"line":726,"column":12}}]},"45":{"line":728,"type":"binary-expr","locations":[{"start":{"line":728,"column":37},"end":{"line":728,"column":40}},{"start":{"line":728,"column":44},"end":{"line":728,"column":46}}]},"46":{"line":730,"type":"if","locations":[{"start":{"line":730,"column":16},"end":{"line":730,"column":16}},{"start":{"line":730,"column":16},"end":{"line":730,"column":16}}]},"47":{"line":780,"type":"binary-expr","locations":[{"start":{"line":780,"column":8},"end":{"line":780,"column":15}},{"start":{"line":780,"column":20},"end":{"line":780,"column":32}}]},"48":{"line":784,"type":"binary-expr","locations":[{"start":{"line":784,"column":23},"end":{"line":784,"column":31}},{"start":{"line":784,"column":35},"end":{"line":784,"column":71}}]},"49":{"line":785,"type":"binary-expr","locations":[{"start":{"line":785,"column":23},"end":{"line":785,"column":40}},{"start":{"line":785,"column":44},"end":{"line":785,"column":52}}]},"50":{"line":789,"type":"if","locations":[{"start":{"line":789,"column":8},"end":{"line":789,"column":8}},{"start":{"line":789,"column":8},"end":{"line":789,"column":8}}]},"51":{"line":790,"type":"binary-expr","locations":[{"start":{"line":790,"column":19},"end":{"line":790,"column":27}},{"start":{"line":790,"column":31},"end":{"line":790,"column":59}}]},"52":{"line":796,"type":"if","locations":[{"start":{"line":796,"column":8},"end":{"line":796,"column":8}},{"start":{"line":796,"column":8},"end":{"line":796,"column":8}}]}},"code":["(function () { YUI.add('app-base', function (Y, NAME) {","","/**","The App Framework provides simple MVC-like building blocks (models, model lists,","views, and URL-based routing) for writing single-page JavaScript applications.","","@main app","@module app","@since 3.4.0","**/","","/**","Provides a top-level application component which manages navigation and views.","","@module app","@submodule app-base","@since 3.5.0","**/","","// TODO: Better handling of lifecycle for registered views:","//","//   * [!] Just redo basically everything with view management so there are no","//     pre-`activeViewChange` side effects and handle the rest of these things:","//","//   * Seems like any view created via `createView` should listen for the view's","//     `destroy` event and use that to remove it from the `_viewsInfoMap`. I","//     should look at what ModelList does for Models as a reference.","//","//   * Should we have a companion `destroyView()` method? Maybe this wouldn't be","//     needed if we have a `getView(name, create)` method, and already doing the","//     above? We could do `app.getView('foo').destroy()` and it would be removed","//     from the `_viewsInfoMap` as well.","//","//   * Should we wait to call a view's `render()` method inside of the","//     `_attachView()` method?","//","//   * Should named views support a collection of instances instead of just one?","//","","var Lang    = Y.Lang,","    YObject = Y.Object,","","    PjaxBase = Y.PjaxBase,","    Router   = Y.Router,","    View     = Y.View,","","    getClassName = Y.ClassNameManager.getClassName,","","    win = Y.config.win,","","    AppBase;","","/**","Provides a top-level application component which manages navigation and views.","","This gives you a foundation and structure on which to build your application; it","combines robust URL navigation with powerful routing and flexible view","management.","","@class App.Base","@param {Object} [config] The following are configuration properties that can be","    specified _in addition_ to default attribute values and the non-attribute","    properties provided by `Y.Base`:","  @param {Object} [config.views] Hash of view-name to metadata used to","    declaratively describe an application's views and their relationship with","    the app and other views. The views specified here will override any defaults","    provided by the `views` object on the `prototype`.","@constructor","@extends Base","@uses View","@uses Router","@uses PjaxBase","@since 3.5.0","**/","AppBase = Y.Base.create('app', Y.Base, [View, Router, PjaxBase], {","    // -- Public Properties ----------------------------------------------------","","    /**","    Hash of view-name to metadata used to declaratively describe an","    application's views and their relationship with the app and its other views.","","    The view metadata is composed of Objects keyed to a view-name that can have","    any or all of the following properties:","","      * `type`: Function or a string representing the view constructor to use to","        create view instances. If a string is used, the constructor function is","        assumed to be on the `Y` object; e.g. `\\"SomeView\\"` -> `Y.SomeView`.","","      * `preserve`: Boolean for whether the view instance should be retained. By","        default, the view instance will be destroyed when it is no longer the","        `activeView`. If `true` the view instance will simply be `removed()`","        from the DOM when it is no longer active. This is useful when the view","        is frequently used and may be expensive to re-create.","","      * `parent`: String to another named view in this hash that represents the","        parent view within the application's view hierarchy; e.g. a `\\"photo\\"`","        view could have `\\"album\\"` has its `parent` view. This parent/child","        relationship is a useful cue for things like transitions.","","      * `instance`: Used internally to manage the current instance of this named","        view. This can be used if your view instance is created up-front, or if","        you would rather manage the View lifecycle, but you probably should just","        let this be handled for you.","","    If `views` are specified at instantiation time, the metadata in the `views`","    Object here will be used as defaults when creating the instance's `views`.","","    Every `Y.App` instance gets its own copy of a `views` object so this Object","    on the prototype will not be polluted.","","    @example","        // Imagine that `Y.UsersView` and `Y.UserView` have been defined.","        var app = new Y.App({","            views: {","                users: {","                    type    : Y.UsersView,","                    preserve: true","                },","","                user: {","                    type  : Y.UserView,","                    parent: 'users'","                }","            }","        });","","    @property views","    @type Object","    @default {}","    @since 3.5.0","    **/","    views: {},","","    // -- Protected Properties -------------------------------------------------","","    /**","    Map of view instance id (via `Y.stamp()`) to view-info object in `views`.","","    This mapping is used to tie a specific view instance back to its metadata by","    adding a reference to the the related view info on the `views` object.","","    @property _viewInfoMap","    @type Object","    @default {}","    @protected","    @since 3.5.0","    **/","","    // -- Lifecycle Methods ----------------------------------------------------","    initializer: function (config) {","        config || (config = {});","","        var views = {};","","        // Merges-in specified view metadata into local `views` object.","        function mergeViewConfig(view, name) {","            views[name] = Y.merge(views[name], view);","        }","","        // First, each view in the `views` prototype object gets its metadata","        // merged-in, providing the defaults.","        YObject.each(this.views, mergeViewConfig);","","        // Then, each view in the specified `config.views` object gets its","        // metadata merged-in.","        YObject.each(config.views, mergeViewConfig);","","        // The resulting hodgepodge of metadata is then stored as the instance's","        // `views` object, and no one's objects were harmed in the making.","        this.views        = views;","        this._viewInfoMap = {};","","        // Using `bind()` to aid extensibility.","        this.after('activeViewChange', Y.bind('_afterActiveViewChange', this));","","        // PjaxBase will bind click events when `html5` is `true`, so this just","        // forces the binding when `serverRouting` and `html5` are both falsy.","        if (!this.get('serverRouting')) {","            this._pjaxBindUI();","        }","    },","","    // TODO: `destructor` to destroy the `activeView`?","","    // -- Public Methods -------------------------------------------------------","","    /**","    Creates and returns a new view instance using the provided `name` to look up","    the view info metadata defined in the `views` object. The passed-in `config`","    object is passed to the view constructor function.","","    This function also maps a view instance back to its view info metadata.","","    @method createView","    @param {String} name The name of a view defined on the `views` object.","    @param {Object} [config] The configuration object passed to the view","      constructor function when creating the new view instance.","    @return {View} The new view instance.","    @since 3.5.0","    **/","    createView: function (name, config) {","        var viewInfo = this.getViewInfo(name),","            type     = (viewInfo && viewInfo.type) || View,","            ViewConstructor, view;","","        // Looks for a namespaced constructor function on `Y`.","        ViewConstructor = Lang.isString(type) ?","                YObject.getValue(Y, type.split('.')) : type;","","        // Create the view instance and map it with its metadata.","        view = new ViewConstructor(config);","        this._viewInfoMap[Y.stamp(view, true)] = viewInfo;","","        return view;","    },","","    /**","    Returns the metadata associated with a view instance or view name defined on","    the `views` object.","","    @method getViewInfo","    @param {View|String} view View instance, or name of a view defined on the","      `views` object.","    @return {Object} The metadata for the view, or `undefined` if the view is","      not registered.","    @since 3.5.0","    **/","    getViewInfo: function (view) {","        if (Lang.isString(view)) {","            return this.views[view];","        }","","        return view && this._viewInfoMap[Y.stamp(view, true)];","    },","","    /**","    Navigates to the specified URL if there is a route handler that matches. In","    browsers capable of using HTML5 history or when `serverRouting` is falsy,","    the navigation will be enhanced by firing the `navigate` event and having","    the app handle the \\"request\\". When `serverRouting` is `true`, non-HTML5","    browsers will navigate to the new URL via a full page reload.","","    When there is a route handler for the specified URL and it is being","    navigated to, this method will return `true`, otherwise it will return","    `false`.","","    **Note:** The specified URL _must_ be of the same origin as the current URL,","    otherwise an error will be logged and navigation will not occur. This is","    intended as both a security constraint and a purposely imposed limitation as","    it does not make sense to tell the app to navigate to a URL on a","    different scheme, host, or port.","","    @method navigate","    @param {String} url The URL to navigate to. This must be of the same origin","      as the current URL.","    @param {Object} [options] Additional options to configure the navigation.","      These are mixed into the `navigate` event facade.","        @param {Boolean} [options.replace] Whether or not the current history","          entry will be replaced, or a new entry will be created. Will default","          to `true` if the specified `url` is the same as the current URL.","        @param {Boolean} [options.force] Whether the enhanced navigation","          should occur even in browsers without HTML5 history. Will default to","          `true` when `serverRouting` is falsy.","    @see PjaxBase.navigate()","    **/","    // Does not override `navigate()` but does use extra `options`.","","    /**","    Renders this application by appending the `viewContainer` node to the","    `container` node if it isn't already a child of the container, and the","    `activeView` will be appended the view container, if it isn't already.","","    You should call this method at least once, usually after the initialization","    of your app instance so the proper DOM structure is setup and optionally","    append the container to the DOM if it's not there already.","","    You may override this method to customize the app's rendering, but you","    should expect that the `viewContainer`'s contents will be modified by the","    app for the purpose of rendering the `activeView` when it changes.","","    @method render","    @chainable","    @see View.render()","    **/","    render: function () {","        var CLASS_NAMES         = Y.App.CLASS_NAMES,","            container           = this.get('container'),","            viewContainer       = this.get('viewContainer'),","            activeView          = this.get('activeView'),","            activeViewContainer = activeView && activeView.get('container'),","            areSame             = container.compareTo(viewContainer);","","        container.addClass(CLASS_NAMES.app);","        viewContainer.addClass(CLASS_NAMES.views);","","        // Prevents needless shuffling around of nodes and maintains DOM order.","        if (activeView && !viewContainer.contains(activeViewContainer)) {","            viewContainer.appendChild(activeViewContainer);","        }","","        // Prevents needless shuffling around of nodes and maintains DOM order.","        if (!container.contains(viewContainer) && !areSame) {","            container.appendChild(viewContainer);","        }","","        return this;","    },","","    /**","    Sets which view is active/visible for the application. This will set the","    app's `activeView` attribute to the specified `view`.","","    The `view` will be \\"attached\\" to this app, meaning it will be both rendered","    into this app's `viewContainer` node and all of its events will bubble to","    the app. The previous `activeView` will be \\"detached\\" from this app.","","    When a string-name is provided for a view which has been registered on this","    app's `views` object, the referenced metadata will be used and the","    `activeView` will be set to either a preserved view instance, or a new","    instance of the registered view will be created using the specified `config`","    object passed-into this method.","","    A callback function can be specified as either the third or fourth argument,","    and this function will be called after the new `view` becomes the","    `activeView`, is rendered to the `viewContainer`, and is ready to use.","","    @example","        var app = new Y.App({","            views: {","                usersView: {","                    // Imagine that `Y.UsersView` has been defined.","                    type: Y.UsersView","                }","            },","","            users: new Y.ModelList()","        });","","        app.route('/users/', function () {","            this.showView('usersView', {users: this.get('users')});","        });","","        app.render();","        app.navigate('/uses/'); // => Creates a new `Y.UsersView` and shows it.","","    @method showView","    @param {String|View} view The name of a view defined in the `views` object,","        or a view instance which should become this app's `activeView`.","    @param {Object} [config] Optional configuration to use when creating a new","        view instance. This config object can also be used to update an existing","        or preserved view's attributes when `options.update` is `true`.","    @param {Object} [options] Optional object containing any of the following","        properties:","      @param {Function} [options.callback] Optional callback function to call","        after new `activeView` is ready to use, the function will be passed:","          @param {View} options.callback.view A reference to the new","            `activeView`.","      @param {Boolean} [options.prepend=false] Whether the `view` should be","        prepended instead of appended to the `viewContainer`.","      @param {Boolean} [options.render] Whether the `view` should be rendered.","        **Note:** If no value is specified, a view instance will only be","        rendered if it's newly created by this method.","      @param {Boolean} [options.update=false] Whether an existing view should","        have its attributes updated by passing the `config` object to its","        `setAttrs()` method. **Note:** This option does not have an effect if","        the `view` instance is created as a result of calling this method.","    @param {Function} [callback] Optional callback Function to call after the","        new `activeView` is ready to use. **Note:** this will override","        `options.callback` and it can be specified as either the third or fourth","        argument. The function will be passed the following:","      @param {View} callback.view A reference to the new `activeView`.","    @chainable","    @since 3.5.0","    **/","    showView: function (view, config, options, callback) {","        var viewInfo, created;","","        options || (options = {});","","        // Support the callback function being either the third or fourth arg.","        if (callback) {","            options = Y.merge(options, {callback: callback});","        } else if (Lang.isFunction(options)) {","            options = {callback: options};","        }","","        if (Lang.isString(view)) {","            viewInfo = this.getViewInfo(view);","","            // Use the preserved view instance, or create a new view.","            // TODO: Maybe we can remove the strict check for `preserve` and","            // assume we'll use a View instance if it is there, and just check","            // `preserve` when detaching?","            if (viewInfo && viewInfo.preserve && viewInfo.instance) {","                view = viewInfo.instance;","","                // Make sure there's a mapping back to the view metadata.","                this._viewInfoMap[Y.stamp(view, true)] = viewInfo;","            } else {","                // TODO: Add the app as a bubble target during construction, but","                // make sure to check that it isn't already in `bubbleTargets`!","                // This will allow the app to be notified for about _all_ of the","                // view's events. **Note:** This should _only_ happen if the","                // view is created _after_ `activeViewChange`.","","                view    = this.createView(view, config);","                created = true;","            }","        }","","        // Update the specified or preserved `view` when signaled to do so.","        // There's no need to updated a view if it was _just_ created.","        if (options.update && !created) {","            view.setAttrs(config);","        }","","        // TODO: Hold off on rendering the view until after it has been","        // \\"attached\\", and move the call to render into `_attachView()`.","","        // When a value is specified for `options.render`, prefer it because it","        // represents the developer's intent. When no value is specified, the","        // `view` will only be rendered if it was just created.","        if ('render' in options) {","            if (options.render) {","                view.render();","            }","        } else if (created) {","            view.render();","        }","","        return this._set('activeView', view, {options: options});","    },","","    // -- Protected Methods ----------------------------------------------------","","    /**","    Helper method to attach the view instance to the application by making the","    app a bubble target of the view, append the view to the `viewContainer`, and","    assign it to the `instance` property of the associated view info metadata.","","    @method _attachView","    @param {View} view View to attach.","    @param {Boolean} prepend=false Whether the view should be prepended instead","      of appended to the `viewContainer`.","    @protected","    @since 3.5.0","    **/","    _attachView: function (view, prepend) {","        if (!view) {","            return;","        }","","        var viewInfo      = this.getViewInfo(view),","            viewContainer = this.get('viewContainer');","","        // Bubble the view's events to this app.","        view.addTarget(this);","","        // Save the view instance in the `views` registry.","        if (viewInfo) {","            viewInfo.instance = view;","        }","","        // TODO: Attach events here for persevered Views?","        // See related TODO in `_detachView`.","","        // TODO: Actually render the view here so that it gets \\"attached\\" before","        // it gets rendered?","","        // Insert view into the DOM.","        viewContainer[prepend ? 'prepend' : 'append'](view.get('container'));","    },","","    /**","    Overrides View's container destruction to deal with the `viewContainer` and","    checks to make sure not to remove and purge the `<body>`.","","    @method _destroyContainer","    @protected","    @see View._destroyContainer()","    **/","    _destroyContainer: function () {","        var CLASS_NAMES   = Y.App.CLASS_NAMES,","            container     = this.get('container'),","            viewContainer = this.get('viewContainer'),","            areSame       = container.compareTo(viewContainer);","","        // We do not want to remove or destroy the `<body>`.","        if (Y.one('body').compareTo(container)) {","            // Just clean-up our events listeners.","            this.detachEvents();","","            // Clean-up `yui3-app` CSS class on the `container`.","            container.removeClass(CLASS_NAMES.app);","","            if (areSame) {","                // Clean-up `yui3-app-views` CSS class on the `container`.","                container.removeClass(CLASS_NAMES.views);","            } else {","                // Destroy and purge the `viewContainer`.","                viewContainer.remove(true);","            }","","            return;","        }","","        // Remove and purge events from both containers.","","        viewContainer.remove(true);","","        if (!areSame) {","            container.remove(true);","        }","    },","","    /**","    Helper method to detach the view instance from the application by removing","    the application as a bubble target of the view, and either just removing the","    view if it is intended to be preserved, or destroying the instance","    completely.","","    @method _detachView","    @param {View} view View to detach.","    @protected","    @since 3.5.0","    **/","    _detachView: function (view) {","        if (!view) {","            return;","        }","","        var viewInfo = this.getViewInfo(view) || {};","","        if (viewInfo.preserve) {","            view.remove();","            // TODO: Detach events here for preserved Views? It is possible that","            // some event subscriptions are made on elements other than the","            // View's `container`.","        } else {","            view.destroy({remove: true});","","            // TODO: The following should probably happen automagically from","            // `destroy()` being called! Possibly `removeTarget()` as well.","","            // Remove from view to view-info map.","            delete this._viewInfoMap[Y.stamp(view, true)];","","            // Remove from view-info instance property.","            if (view === viewInfo.instance) {","                delete viewInfo.instance;","            }","        }","","        view.removeTarget(this);","    },","","    /**","    Getter for the `viewContainer` attribute.","","    @method _getViewContainer","    @param {Node|null} value Current attribute value.","    @return {Node} View container node.","    @protected","    @since 3.5.0","    **/","    _getViewContainer: function (value) {","        // This wackiness is necessary to enable fully lazy creation of the","        // container node both when no container is specified and when one is","        // specified via a valueFn.","","        if (!value && !this._viewContainer) {","            // Create a default container and set that as the new attribute","            // value. The `this._viewContainer` property prevents infinite","            // recursion.","            value = this._viewContainer = this.create();","            this._set('viewContainer', value);","        }","","        return value;","    },","","    /**","    Provides the default value for the `html5` attribute.","","    The value returned is dependent on the value of the `serverRouting`","    attribute. When `serverRouting` is explicit set to `false` (not just falsy),","    the default value for `html5` will be set to `false` for *all* browsers.","","    When `serverRouting` is `true` or `undefined` the returned value will be","    dependent on the browser's capability of using HTML5 history.","","    @method _initHtml5","    @return {Boolean} Whether or not HTML5 history should be used.","    @protected","    @since 3.5.0","    **/","    _initHtml5: function () {","        // When `serverRouting` is explicitly set to `false` (not just falsy),","        // forcing hash-based URLs in all browsers.","        if (this.get('serverRouting') === false) {","            return false;","        }","","        // Defaults to whether or not the browser supports HTML5 history.","        return Router.html5;","    },","","    /**","    Determines if the specified `view` is configured as a child of the specified","    `parent` view. This requires both views to be either named-views, or view","    instances created using configuration data that exists in the `views`","    object, e.g. created by the `createView()` or `showView()` method.","","    @method _isChildView","    @param {View|String} view The name of a view defined in the `views` object,","      or a view instance.","    @param {View|String} parent The name of a view defined in the `views`","      object, or a view instance.","    @return {Boolean} Whether the view is configured as a child of the parent.","    @protected","    @since 3.5.0","    **/","    _isChildView: function (view, parent) {","        var viewInfo   = this.getViewInfo(view),","            parentInfo = this.getViewInfo(parent);","","        if (viewInfo && parentInfo) {","            return this.getViewInfo(viewInfo.parent) === parentInfo;","        }","","        return false;","    },","","    /**","    Determines if the specified `view` is configured as the parent of the","    specified `child` view. This requires both views to be either named-views,","    or view instances created using configuration data that exists in the","    `views` object, e.g. created by the `createView()` or `showView()` method.","","    @method _isParentView","    @param {View|String} view The name of a view defined in the `views` object,","      or a view instance.","    @param {View|String} parent The name of a view defined in the `views`","      object, or a view instance.","    @return {Boolean} Whether the view is configured as the parent of the child.","    @protected","    @since 3.5.0","    **/","    _isParentView: function (view, child) {","        var viewInfo  = this.getViewInfo(view),","            childInfo = this.getViewInfo(child);","","        if (viewInfo && childInfo) {","            return this.getViewInfo(childInfo.parent) === viewInfo;","        }","","        return false;","    },","","    /**","    Underlying implementation for `navigate()`.","","    @method _navigate","    @param {String} url The fully-resolved URL that the app should dispatch to","      its route handlers to fulfill the enhanced navigation \\"request\\", or use to","      update `window.location` in non-HTML5 history capable browsers when","      `serverRouting` is `true`.","    @param {Object} [options] Additional options to configure the navigation.","      These are mixed into the `navigate` event facade.","        @param {Boolean} [options.replace] Whether or not the current history","          entry will be replaced, or a new entry will be created. Will default","          to `true` if the specified `url` is the same as the current URL.","        @param {Boolean} [options.force] Whether the enhanced navigation","          should occur even in browsers without HTML5 history. Will default to","          `true` when `serverRouting` is falsy.","    @protected","    @see PjaxBase._navigate()","    **/","    _navigate: function (url, options) {","        if (!this.get('serverRouting')) {","            // Force navigation to be enhanced and handled by the app when","            // `serverRouting` is falsy because the server might not be able to","            // properly handle the request.","            options = Y.merge({force: true}, options);","        }","","        return PjaxBase.prototype._navigate.call(this, url, options);","    },","","    /**","    Will either save a history entry using `pushState()` or the location hash,","    or gracefully-degrade to sending a request to the server causing a full-page","    reload.","","    Overrides Router's `_save()` method to preform graceful-degradation when the","    app's `serverRouting` is `true` and `html5` is `false` by updating the full","    URL via standard assignment to `window.location` or by calling","    `window.location.replace()`; both of which will cause a request to the","    server resulting in a full-page reload.","","    Otherwise this will just delegate off to Router's `_save()` method allowing","    the client-side enhanced routing to occur.","","    @method _save","    @param {String} [url] URL for the history entry.","    @param {Boolean} [replace=false] If `true`, the current history entry will","      be replaced instead of a new one being added.","    @chainable","    @protected","    @see Router._save()","    **/","    _save: function (url, replace) {","        var path;","","        // Forces full-path URLs to always be used by modifying","        // `window.location` in non-HTML5 history capable browsers.","        if (this.get('serverRouting') && !this.get('html5')) {","            // Perform same-origin check on the specified URL.","            if (!this._hasSameOrigin(url)) {","                Y.error('Security error: The new URL must be of the same origin as the current URL.');","                return this;","            }","","            // Either replace the current history entry or create a new one","            // while navigating to the `url`.","            if (win) {","                // Results in the URL's full path starting with '/'.","                path = this._joinURL(url || '');","","                if (replace) {","                    win.location.replace(path);","                } else {","                    win.location = path;","                }","            }","","            return this;","        }","","        return Router.prototype._save.apply(this, arguments);","    },","","    /**","    Performs the actual change of this app's `activeView` by attaching the","    `newView` to this app, and detaching the `oldView` from this app using any","    specified `options`.","","    The `newView` is attached to the app by rendering it to the `viewContainer`,","    and making this app a bubble target of its events.","","    The `oldView` is detached from the app by removing it from the","    `viewContainer`, and removing this app as a bubble target for its events.","    The `oldView` will either be preserved or properly destroyed.","","    **Note:** The `activeView` attribute is read-only and can be changed by","    calling the `showView()` method.","","    @method _uiSetActiveView","    @param {View} newView The View which is now this app's `activeView`.","    @param {View} [oldView] The View which was this app's `activeView`.","    @param {Object} [options] Optional object containing any of the following","        properties:","      @param {Function} [options.callback] Optional callback function to call","        after new `activeView` is ready to use, the function will be passed:","          @param {View} options.callback.view A reference to the new","            `activeView`.","      @param {Boolean} [options.prepend=false] Whether the `view` should be","        prepended instead of appended to the `viewContainer`.","      @param {Boolean} [options.render] Whether the `view` should be rendered.","        **Note:** If no value is specified, a view instance will only be","        rendered if it's newly created by this method.","      @param {Boolean} [options.update=false] Whether an existing view should","        have its attributes updated by passing the `config` object to its","        `setAttrs()` method. **Note:** This option does not have an effect if","        the `view` instance is created as a result of calling this method.","    @protected","    @since 3.5.0","    **/","    _uiSetActiveView: function (newView, oldView, options) {","        options || (options = {});","","        var callback = options.callback,","            isChild  = this._isChildView(newView, oldView),","            isParent = !isChild && this._isParentView(newView, oldView),","            prepend  = !!options.prepend || isParent;","","        // Prevent detaching (thus removing) the view we want to show. Also hard","        // to animate out and in, the same view.","        if (newView === oldView) {","            return callback && callback.call(this, newView);","        }","","        this._attachView(newView, prepend);","        this._detachView(oldView);","","        if (callback) {","            callback.call(this, newView);","        }","    },","","    // -- Protected Event Handlers ---------------------------------------------","","    /**","    Handles the application's `activeViewChange` event (which is fired when the","    `activeView` attribute changes) by detaching the old view, attaching the new","    view.","","    The `activeView` attribute is read-only, so the public API to change its","    value is through the `showView()` method.","","    @method _afterActiveViewChange","    @param {EventFacade} e","    @protected","    @since 3.5.0","    **/","    _afterActiveViewChange: function (e) {","        this._uiSetActiveView(e.newVal, e.prevVal, e.options);","    }","}, {","    ATTRS: {","        /**","        The application's active/visible view.","","        This attribute is read-only, to set the `activeView` use the","        `showView()` method.","","        @attribute activeView","        @type View","        @default null","        @readOnly","        @see App.Base.showView()","        @since 3.5.0","        **/","        activeView: {","            value   : null,","            readOnly: true","        },","","        /**","        Container node which represents the application's bounding-box, into","        which this app's content will be rendered.","","        The container node serves as the host for all DOM events attached by the","        app. Delegation is used to handle events on children of the container,","        allowing the container's contents to be re-rendered at any time without","        losing event subscriptions.","","        The default container is the `<body>` Node, but you can override this in","        a subclass, or by passing in a custom `container` config value at","        instantiation time.","","        When `container` is overridden by a subclass or passed as a config","        option at instantiation time, it may be provided as a selector string, a","        DOM element, or a `Y.Node` instance. During initialization, this app's","        `create()` method will be called to convert the container into a","        `Y.Node` instance if it isn't one already and stamp it with the CSS","        class: `\\"yui3-app\\"`.","","        The container is not added to the page automatically. This allows you to","        have full control over how and when your app is actually rendered to","        the page.","","        @attribute container","        @type HTMLElement|Node|String","        @default Y.one('body')","        @initOnly","        **/","        container: {","            valueFn: function () {","                return Y.one('body');","            }","        },","","        /**","        Whether or not this browser is capable of using HTML5 history.","","        This value is dependent on the value of `serverRouting` and will default","        accordingly.","","        Setting this to `false` will force the use of hash-based history even on","        HTML5 browsers, but please don't do this unless you understand the","        consequences.","","        @attribute html5","        @type Boolean","        @initOnly","        @see serverRouting","        **/","        html5: {","            valueFn: '_initHtml5'","        },","","        /**","        CSS selector string used to filter link click events so that only the","        links which match it will have the enhanced-navigation behavior of pjax","        applied.","","        When a link is clicked and that link matches this selector, navigating","        to the link's `href` URL using the enhanced, pjax, behavior will be","        attempted; and the browser's default way to navigate to new pages will","        be the fallback.","","        By default this selector will match _all_ links on the page.","","        @attribute linkSelector","        @type String|Function","        @default \\"a\\"","        **/","        linkSelector: {","            value: 'a'","        },","","        /**","        Whether or not this application's server is capable of properly routing","        all requests and rendering the initial state in the HTML responses.","","        This can have three different values, each having particular","        implications on how the app will handle routing and navigation:","","          * `undefined`: The best form of URLs will be chosen based on the","            capabilities of the browser. Given no information about the server","            environmentm a balanced approach to routing and navigation is","            chosen.","","            The server should be capable of handling full-path requests, since","            full-URLs will be generated by browsers using HTML5 history. If this","            is a client-side-only app the server could handle full-URL requests","            by sending a redirect back to the root with a hash-based URL, e.g:","","                Request:     http://example.com/users/1","                Redirect to: http://example.com/#/users/1","","          * `true`: The server is *fully* capable of properly handling requests","            to all full-path URLs the app can produce.","","            This is the best option for progressive-enhancement because it will","            cause **all URLs to always have full-paths**, which means the server","            will be able to accurately handle all URLs this app produces. e.g.","","                http://example.com/users/1","","            To meet this strict full-URL requirement, browsers which are not","            capable of using HTML5 history will make requests to the server","            resulting in full-page reloads.","","          * `false`: The server is *not* capable of properly handling requests","            to all full-path URLs the app can produce, therefore all routing","            will be handled by this App instance.","","            Be aware that this will cause **all URLs to always be hash-based**,","            even in browsers that are capable of using HTML5 history. e.g.","","                http://example.com/#/users/1","","            A single-page or client-side-only app where the server sends a","            \\"shell\\" page with JavaScript to the client might have this","            restriction. If you're setting this to `false`, read the following:","","        **Note:** When this is set to `false`, the server will *never* receive","        the full URL because browsers do not send the fragment-part to the","        server, that is everything after and including the \\"#\\".","","        Consider the following example:","","            URL shown in browser: http://example.com/#/users/1","            URL sent to server:   http://example.com/","","        You should feel bad about hurting our precious web if you forcefully set","        either `serverRouting` or `html5` to `false`, because you're basically","        punching the web in the face here with your lossy URLs! Please make sure","        you know what you're doing and that you understand the implications.","","        Ideally you should always prefer full-path URLs (not /#/foo/), and want","        full-page reloads when the client's browser is not capable of enhancing","        the experience using the HTML5 history APIs. Setting this to `true` is","        the best option for progressive-enhancement (and graceful-degradation).","","        @attribute serverRouting","        @type Boolean","        @default undefined","        @initOnly","        @since 3.5.0","        **/","        serverRouting: {","            valueFn  : function () { return Y.App.serverRouting; },","            writeOnce: 'initOnly'","        },","","        /**","        The node into which this app's `views` will be rendered when they become","        the `activeView`.","","        The view container node serves as the container to hold the app's","        `activeView`. Each time the `activeView` is set via `showView()`, the","        previous view will be removed from this node, and the new active view's","        `container` node will be appended.","","        The default view container is a `<div>` Node, but you can override this","        in a subclass, or by passing in a custom `viewContainer` config value at","        instantiation time. The `viewContainer` may be provided as a selector","        string, DOM element, or a `Y.Node` instance (having the `viewContainer`","        and the `container` be the same node is also supported).","","        The app's `render()` method will stamp the view container with the CSS","        class `\\"yui3-app-views\\"` and append it to the app's `container` node if","        it isn't already, and any `activeView` will be appended to this node if","        it isn't already.","","        @attribute viewContainer","        @type HTMLElement|Node|String","        @default Y.Node.create(this.containerTemplate)","        @initOnly","        @since 3.5.0","        **/","        viewContainer: {","            getter   : '_getViewContainer',","            setter   : Y.one,","            writeOnce: true","        }","    },","","    /**","    Properties that shouldn't be turned into ad-hoc attributes when passed to","    App's constructor.","","    @property _NON_ATTRS_CFG","    @type Array","    @static","    @protected","    @since 3.5.0","    **/","    _NON_ATTRS_CFG: ['views']","});","","// -- Namespace ----------------------------------------------------------------","Y.namespace('App').Base = AppBase;","","/**","Provides a top-level application component which manages navigation and views.","","This gives you a foundation and structure on which to build your application; it","combines robust URL navigation with powerful routing and flexible view","management.","","`Y.App` is both a namespace and constructor function. The `Y.App` class is","special in that any `Y.App` class extensions that are included in the YUI","instance will be **auto-mixed** on to the `Y.App` class. Consider this example:","","    YUI().use('app-base', 'app-transitions', function (Y) {","        // This will create two YUI Apps, `basicApp` will not have transitions,","        // but `fancyApp` will have transitions support included and turn it on.","        var basicApp = new Y.App.Base(),","            fancyApp = new Y.App({transitions: true});","    });","","@class App","@param {Object} [config] The following are configuration properties that can be","    specified _in addition_ to default attribute values and the non-attribute","    properties provided by `Y.Base`:","  @param {Object} [config.views] Hash of view-name to metadata used to","    declaratively describe an application's views and their relationship with","    the app and other views. The views specified here will override any defaults","    provided by the `views` object on the `prototype`.","@constructor","@extends App.Base","@uses App.Content","@uses App.Transitions","@uses PjaxContent","@since 3.5.0","**/","Y.App = Y.mix(Y.Base.create('app', AppBase, []), Y.App, true);","","/**","CSS classes used by `Y.App`.","","@property CLASS_NAMES","@type Object","@default {}","@static","@since 3.6.0","**/","Y.App.CLASS_NAMES = {","    app  : getClassName('app'),","    views: getClassName('app', 'views')","};","","/**","Default `serverRouting` attribute value for all apps.","","@property serverRouting","@type Boolean","@default undefined","@static","@since 3.6.0","**/","","","}, '3.12.0', {\\"requires\\": [\\"classnamemanager\\", \\"pjax-base\\", \\"router\\", \\"view\\"]});","","}());"]};
						}
						var __cov_Mp7RJfZTHE8HCU_KerbXfA = __coverage__['build/app-base/app-base.js'];
						__cov_Mp7RJfZTHE8HCU_KerbXfA.s['1']++;YUI.add('app-base',function(Y,NAME){__cov_Mp7RJfZTHE8HCU_KerbXfA.f['1']++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['2']++;var Lang=Y.Lang,YObject=Y.Object,PjaxBase=Y.PjaxBase,Router=Y.Router,View=Y.View,getClassName=Y.ClassNameManager.getClassName,win=Y.config.win,AppBase;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['3']++;AppBase=Y.Base.create('app',Y.Base,[View,Router,PjaxBase],{views:{},initializer:function(config){__cov_Mp7RJfZTHE8HCU_KerbXfA.f['2']++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['4']++;(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['1'][0]++,config)||(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['1'][1]++,config={});__cov_Mp7RJfZTHE8HCU_KerbXfA.s['5']++;var views={};__cov_Mp7RJfZTHE8HCU_KerbXfA.s['6']++;function mergeViewConfig(view,name){__cov_Mp7RJfZTHE8HCU_KerbXfA.f['3']++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['7']++;views[name]=Y.merge(views[name],view);}__cov_Mp7RJfZTHE8HCU_KerbXfA.s['8']++;YObject.each(this.views,mergeViewConfig);__cov_Mp7RJfZTHE8HCU_KerbXfA.s['9']++;YObject.each(config.views,mergeViewConfig);__cov_Mp7RJfZTHE8HCU_KerbXfA.s['10']++;this.views=views;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['11']++;this._viewInfoMap={};__cov_Mp7RJfZTHE8HCU_KerbXfA.s['12']++;this.after('activeViewChange',Y.bind('_afterActiveViewChange',this));__cov_Mp7RJfZTHE8HCU_KerbXfA.s['13']++;if(!this.get('serverRouting')){__cov_Mp7RJfZTHE8HCU_KerbXfA.b['2'][0]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['14']++;this._pjaxBindUI();}else{__cov_Mp7RJfZTHE8HCU_KerbXfA.b['2'][1]++;}},createView:function(name,config){__cov_Mp7RJfZTHE8HCU_KerbXfA.f['4']++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['15']++;var viewInfo=this.getViewInfo(name),type=(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['3'][0]++,viewInfo)&&(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['3'][1]++,viewInfo.type)||(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['3'][2]++,View),ViewConstructor,view;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['16']++;ViewConstructor=Lang.isString(type)?(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['4'][0]++,YObject.getValue(Y,type.split('.'))):(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['4'][1]++,type);__cov_Mp7RJfZTHE8HCU_KerbXfA.s['17']++;view=new ViewConstructor(config);__cov_Mp7RJfZTHE8HCU_KerbXfA.s['18']++;this._viewInfoMap[Y.stamp(view,true)]=viewInfo;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['19']++;return view;},getViewInfo:function(view){__cov_Mp7RJfZTHE8HCU_KerbXfA.f['5']++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['20']++;if(Lang.isString(view)){__cov_Mp7RJfZTHE8HCU_KerbXfA.b['5'][0]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['21']++;return this.views[view];}else{__cov_Mp7RJfZTHE8HCU_KerbXfA.b['5'][1]++;}__cov_Mp7RJfZTHE8HCU_KerbXfA.s['22']++;return(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['6'][0]++,view)&&(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['6'][1]++,this._viewInfoMap[Y.stamp(view,true)]);},render:function(){__cov_Mp7RJfZTHE8HCU_KerbXfA.f['6']++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['23']++;var CLASS_NAMES=Y.App.CLASS_NAMES,container=this.get('container'),viewContainer=this.get('viewContainer'),activeView=this.get('activeView'),activeViewContainer=(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['7'][0]++,activeView)&&(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['7'][1]++,activeView.get('container')),areSame=container.compareTo(viewContainer);__cov_Mp7RJfZTHE8HCU_KerbXfA.s['24']++;container.addClass(CLASS_NAMES.app);__cov_Mp7RJfZTHE8HCU_KerbXfA.s['25']++;viewContainer.addClass(CLASS_NAMES.views);__cov_Mp7RJfZTHE8HCU_KerbXfA.s['26']++;if((__cov_Mp7RJfZTHE8HCU_KerbXfA.b['9'][0]++,activeView)&&(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['9'][1]++,!viewContainer.contains(activeViewContainer))){__cov_Mp7RJfZTHE8HCU_KerbXfA.b['8'][0]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['27']++;viewContainer.appendChild(activeViewContainer);}else{__cov_Mp7RJfZTHE8HCU_KerbXfA.b['8'][1]++;}__cov_Mp7RJfZTHE8HCU_KerbXfA.s['28']++;if((__cov_Mp7RJfZTHE8HCU_KerbXfA.b['11'][0]++,!container.contains(viewContainer))&&(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['11'][1]++,!areSame)){__cov_Mp7RJfZTHE8HCU_KerbXfA.b['10'][0]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['29']++;container.appendChild(viewContainer);}else{__cov_Mp7RJfZTHE8HCU_KerbXfA.b['10'][1]++;}__cov_Mp7RJfZTHE8HCU_KerbXfA.s['30']++;return this;},showView:function(view,config,options,callback){__cov_Mp7RJfZTHE8HCU_KerbXfA.f['7']++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['31']++;var viewInfo,created;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['32']++;(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['12'][0]++,options)||(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['12'][1]++,options={});__cov_Mp7RJfZTHE8HCU_KerbXfA.s['33']++;if(callback){__cov_Mp7RJfZTHE8HCU_KerbXfA.b['13'][0]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['34']++;options=Y.merge(options,{callback:callback});}else{__cov_Mp7RJfZTHE8HCU_KerbXfA.b['13'][1]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['35']++;if(Lang.isFunction(options)){__cov_Mp7RJfZTHE8HCU_KerbXfA.b['14'][0]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['36']++;options={callback:options};}else{__cov_Mp7RJfZTHE8HCU_KerbXfA.b['14'][1]++;}}__cov_Mp7RJfZTHE8HCU_KerbXfA.s['37']++;if(Lang.isString(view)){__cov_Mp7RJfZTHE8HCU_KerbXfA.b['15'][0]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['38']++;viewInfo=this.getViewInfo(view);__cov_Mp7RJfZTHE8HCU_KerbXfA.s['39']++;if((__cov_Mp7RJfZTHE8HCU_KerbXfA.b['17'][0]++,viewInfo)&&(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['17'][1]++,viewInfo.preserve)&&(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['17'][2]++,viewInfo.instance)){__cov_Mp7RJfZTHE8HCU_KerbXfA.b['16'][0]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['40']++;view=viewInfo.instance;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['41']++;this._viewInfoMap[Y.stamp(view,true)]=viewInfo;}else{__cov_Mp7RJfZTHE8HCU_KerbXfA.b['16'][1]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['42']++;view=this.createView(view,config);__cov_Mp7RJfZTHE8HCU_KerbXfA.s['43']++;created=true;}}else{__cov_Mp7RJfZTHE8HCU_KerbXfA.b['15'][1]++;}__cov_Mp7RJfZTHE8HCU_KerbXfA.s['44']++;if((__cov_Mp7RJfZTHE8HCU_KerbXfA.b['19'][0]++,options.update)&&(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['19'][1]++,!created)){__cov_Mp7RJfZTHE8HCU_KerbXfA.b['18'][0]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['45']++;view.setAttrs(config);}else{__cov_Mp7RJfZTHE8HCU_KerbXfA.b['18'][1]++;}__cov_Mp7RJfZTHE8HCU_KerbXfA.s['46']++;if('render'in options){__cov_Mp7RJfZTHE8HCU_KerbXfA.b['20'][0]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['47']++;if(options.render){__cov_Mp7RJfZTHE8HCU_KerbXfA.b['21'][0]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['48']++;view.render();}else{__cov_Mp7RJfZTHE8HCU_KerbXfA.b['21'][1]++;}}else{__cov_Mp7RJfZTHE8HCU_KerbXfA.b['20'][1]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['49']++;if(created){__cov_Mp7RJfZTHE8HCU_KerbXfA.b['22'][0]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['50']++;view.render();}else{__cov_Mp7RJfZTHE8HCU_KerbXfA.b['22'][1]++;}}__cov_Mp7RJfZTHE8HCU_KerbXfA.s['51']++;return this._set('activeView',view,{options:options});},_attachView:function(view,prepend){__cov_Mp7RJfZTHE8HCU_KerbXfA.f['8']++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['52']++;if(!view){__cov_Mp7RJfZTHE8HCU_KerbXfA.b['23'][0]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['53']++;return;}else{__cov_Mp7RJfZTHE8HCU_KerbXfA.b['23'][1]++;}__cov_Mp7RJfZTHE8HCU_KerbXfA.s['54']++;var viewInfo=this.getViewInfo(view),viewContainer=this.get('viewContainer');__cov_Mp7RJfZTHE8HCU_KerbXfA.s['55']++;view.addTarget(this);__cov_Mp7RJfZTHE8HCU_KerbXfA.s['56']++;if(viewInfo){__cov_Mp7RJfZTHE8HCU_KerbXfA.b['24'][0]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['57']++;viewInfo.instance=view;}else{__cov_Mp7RJfZTHE8HCU_KerbXfA.b['24'][1]++;}__cov_Mp7RJfZTHE8HCU_KerbXfA.s['58']++;viewContainer[prepend?(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['25'][0]++,'prepend'):(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['25'][1]++,'append')](view.get('container'));},_destroyContainer:function(){__cov_Mp7RJfZTHE8HCU_KerbXfA.f['9']++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['59']++;var CLASS_NAMES=Y.App.CLASS_NAMES,container=this.get('container'),viewContainer=this.get('viewContainer'),areSame=container.compareTo(viewContainer);__cov_Mp7RJfZTHE8HCU_KerbXfA.s['60']++;if(Y.one('body').compareTo(container)){__cov_Mp7RJfZTHE8HCU_KerbXfA.b['26'][0]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['61']++;this.detachEvents();__cov_Mp7RJfZTHE8HCU_KerbXfA.s['62']++;container.removeClass(CLASS_NAMES.app);__cov_Mp7RJfZTHE8HCU_KerbXfA.s['63']++;if(areSame){__cov_Mp7RJfZTHE8HCU_KerbXfA.b['27'][0]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['64']++;container.removeClass(CLASS_NAMES.views);}else{__cov_Mp7RJfZTHE8HCU_KerbXfA.b['27'][1]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['65']++;viewContainer.remove(true);}__cov_Mp7RJfZTHE8HCU_KerbXfA.s['66']++;return;}else{__cov_Mp7RJfZTHE8HCU_KerbXfA.b['26'][1]++;}__cov_Mp7RJfZTHE8HCU_KerbXfA.s['67']++;viewContainer.remove(true);__cov_Mp7RJfZTHE8HCU_KerbXfA.s['68']++;if(!areSame){__cov_Mp7RJfZTHE8HCU_KerbXfA.b['28'][0]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['69']++;container.remove(true);}else{__cov_Mp7RJfZTHE8HCU_KerbXfA.b['28'][1]++;}},_detachView:function(view){__cov_Mp7RJfZTHE8HCU_KerbXfA.f['10']++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['70']++;if(!view){__cov_Mp7RJfZTHE8HCU_KerbXfA.b['29'][0]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['71']++;return;}else{__cov_Mp7RJfZTHE8HCU_KerbXfA.b['29'][1]++;}__cov_Mp7RJfZTHE8HCU_KerbXfA.s['72']++;var viewInfo=(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['30'][0]++,this.getViewInfo(view))||(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['30'][1]++,{});__cov_Mp7RJfZTHE8HCU_KerbXfA.s['73']++;if(viewInfo.preserve){__cov_Mp7RJfZTHE8HCU_KerbXfA.b['31'][0]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['74']++;view.remove();}else{__cov_Mp7RJfZTHE8HCU_KerbXfA.b['31'][1]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['75']++;view.destroy({remove:true});__cov_Mp7RJfZTHE8HCU_KerbXfA.s['76']++;delete this._viewInfoMap[Y.stamp(view,true)];__cov_Mp7RJfZTHE8HCU_KerbXfA.s['77']++;if(view===viewInfo.instance){__cov_Mp7RJfZTHE8HCU_KerbXfA.b['32'][0]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['78']++;delete viewInfo.instance;}else{__cov_Mp7RJfZTHE8HCU_KerbXfA.b['32'][1]++;}}__cov_Mp7RJfZTHE8HCU_KerbXfA.s['79']++;view.removeTarget(this);},_getViewContainer:function(value){__cov_Mp7RJfZTHE8HCU_KerbXfA.f['11']++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['80']++;if((__cov_Mp7RJfZTHE8HCU_KerbXfA.b['34'][0]++,!value)&&(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['34'][1]++,!this._viewContainer)){__cov_Mp7RJfZTHE8HCU_KerbXfA.b['33'][0]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['81']++;value=this._viewContainer=this.create();__cov_Mp7RJfZTHE8HCU_KerbXfA.s['82']++;this._set('viewContainer',value);}else{__cov_Mp7RJfZTHE8HCU_KerbXfA.b['33'][1]++;}__cov_Mp7RJfZTHE8HCU_KerbXfA.s['83']++;return value;},_initHtml5:function(){__cov_Mp7RJfZTHE8HCU_KerbXfA.f['12']++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['84']++;if(this.get('serverRouting')===false){__cov_Mp7RJfZTHE8HCU_KerbXfA.b['35'][0]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['85']++;return false;}else{__cov_Mp7RJfZTHE8HCU_KerbXfA.b['35'][1]++;}__cov_Mp7RJfZTHE8HCU_KerbXfA.s['86']++;return Router.html5;},_isChildView:function(view,parent){__cov_Mp7RJfZTHE8HCU_KerbXfA.f['13']++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['87']++;var viewInfo=this.getViewInfo(view),parentInfo=this.getViewInfo(parent);__cov_Mp7RJfZTHE8HCU_KerbXfA.s['88']++;if((__cov_Mp7RJfZTHE8HCU_KerbXfA.b['37'][0]++,viewInfo)&&(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['37'][1]++,parentInfo)){__cov_Mp7RJfZTHE8HCU_KerbXfA.b['36'][0]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['89']++;return this.getViewInfo(viewInfo.parent)===parentInfo;}else{__cov_Mp7RJfZTHE8HCU_KerbXfA.b['36'][1]++;}__cov_Mp7RJfZTHE8HCU_KerbXfA.s['90']++;return false;},_isParentView:function(view,child){__cov_Mp7RJfZTHE8HCU_KerbXfA.f['14']++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['91']++;var viewInfo=this.getViewInfo(view),childInfo=this.getViewInfo(child);__cov_Mp7RJfZTHE8HCU_KerbXfA.s['92']++;if((__cov_Mp7RJfZTHE8HCU_KerbXfA.b['39'][0]++,viewInfo)&&(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['39'][1]++,childInfo)){__cov_Mp7RJfZTHE8HCU_KerbXfA.b['38'][0]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['93']++;return this.getViewInfo(childInfo.parent)===viewInfo;}else{__cov_Mp7RJfZTHE8HCU_KerbXfA.b['38'][1]++;}__cov_Mp7RJfZTHE8HCU_KerbXfA.s['94']++;return false;},_navigate:function(url,options){__cov_Mp7RJfZTHE8HCU_KerbXfA.f['15']++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['95']++;if(!this.get('serverRouting')){__cov_Mp7RJfZTHE8HCU_KerbXfA.b['40'][0]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['96']++;options=Y.merge({force:true},options);}else{__cov_Mp7RJfZTHE8HCU_KerbXfA.b['40'][1]++;}__cov_Mp7RJfZTHE8HCU_KerbXfA.s['97']++;return PjaxBase.prototype._navigate.call(this,url,options);},_save:function(url,replace){__cov_Mp7RJfZTHE8HCU_KerbXfA.f['16']++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['98']++;var path;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['99']++;if((__cov_Mp7RJfZTHE8HCU_KerbXfA.b['42'][0]++,this.get('serverRouting'))&&(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['42'][1]++,!this.get('html5'))){__cov_Mp7RJfZTHE8HCU_KerbXfA.b['41'][0]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['100']++;if(!this._hasSameOrigin(url)){__cov_Mp7RJfZTHE8HCU_KerbXfA.b['43'][0]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['101']++;Y.error('Security error: The new URL must be of the same origin as the current URL.');__cov_Mp7RJfZTHE8HCU_KerbXfA.s['102']++;return this;}else{__cov_Mp7RJfZTHE8HCU_KerbXfA.b['43'][1]++;}__cov_Mp7RJfZTHE8HCU_KerbXfA.s['103']++;if(win){__cov_Mp7RJfZTHE8HCU_KerbXfA.b['44'][0]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['104']++;path=this._joinURL((__cov_Mp7RJfZTHE8HCU_KerbXfA.b['45'][0]++,url)||(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['45'][1]++,''));__cov_Mp7RJfZTHE8HCU_KerbXfA.s['105']++;if(replace){__cov_Mp7RJfZTHE8HCU_KerbXfA.b['46'][0]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['106']++;win.location.replace(path);}else{__cov_Mp7RJfZTHE8HCU_KerbXfA.b['46'][1]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['107']++;win.location=path;}}else{__cov_Mp7RJfZTHE8HCU_KerbXfA.b['44'][1]++;}__cov_Mp7RJfZTHE8HCU_KerbXfA.s['108']++;return this;}else{__cov_Mp7RJfZTHE8HCU_KerbXfA.b['41'][1]++;}__cov_Mp7RJfZTHE8HCU_KerbXfA.s['109']++;return Router.prototype._save.apply(this,arguments);},_uiSetActiveView:function(newView,oldView,options){__cov_Mp7RJfZTHE8HCU_KerbXfA.f['17']++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['110']++;(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['47'][0]++,options)||(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['47'][1]++,options={});__cov_Mp7RJfZTHE8HCU_KerbXfA.s['111']++;var callback=options.callback,isChild=this._isChildView(newView,oldView),isParent=(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['48'][0]++,!isChild)&&(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['48'][1]++,this._isParentView(newView,oldView)),prepend=(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['49'][0]++,!!options.prepend)||(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['49'][1]++,isParent);__cov_Mp7RJfZTHE8HCU_KerbXfA.s['112']++;if(newView===oldView){__cov_Mp7RJfZTHE8HCU_KerbXfA.b['50'][0]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['113']++;return(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['51'][0]++,callback)&&(__cov_Mp7RJfZTHE8HCU_KerbXfA.b['51'][1]++,callback.call(this,newView));}else{__cov_Mp7RJfZTHE8HCU_KerbXfA.b['50'][1]++;}__cov_Mp7RJfZTHE8HCU_KerbXfA.s['114']++;this._attachView(newView,prepend);__cov_Mp7RJfZTHE8HCU_KerbXfA.s['115']++;this._detachView(oldView);__cov_Mp7RJfZTHE8HCU_KerbXfA.s['116']++;if(callback){__cov_Mp7RJfZTHE8HCU_KerbXfA.b['52'][0]++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['117']++;callback.call(this,newView);}else{__cov_Mp7RJfZTHE8HCU_KerbXfA.b['52'][1]++;}},_afterActiveViewChange:function(e){__cov_Mp7RJfZTHE8HCU_KerbXfA.f['18']++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['118']++;this._uiSetActiveView(e.newVal,e.prevVal,e.options);}},{ATTRS:{activeView:{value:null,readOnly:true},container:{valueFn:function(){__cov_Mp7RJfZTHE8HCU_KerbXfA.f['19']++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['119']++;return Y.one('body');}},html5:{valueFn:'_initHtml5'},linkSelector:{value:'a'},serverRouting:{valueFn:function(){__cov_Mp7RJfZTHE8HCU_KerbXfA.f['20']++;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['120']++;return Y.App.serverRouting;},writeOnce:'initOnly'},viewContainer:{getter:'_getViewContainer',setter:Y.one,writeOnce:true}},_NON_ATTRS_CFG:['views']});__cov_Mp7RJfZTHE8HCU_KerbXfA.s['121']++;Y.namespace('App').Base=AppBase;__cov_Mp7RJfZTHE8HCU_KerbXfA.s['122']++;Y.App=Y.mix(Y.Base.create('app',AppBase,[]),Y.App,true);__cov_Mp7RJfZTHE8HCU_KerbXfA.s['123']++;Y.App.CLASS_NAMES={app:getClassName('app'),views:getClassName('app','views')};},'3.12.0',{'requires':['classnamemanager','pjax-base','router','view']});
						""");
	}

	@Test
	public void testAppTransitionsMin() {
		parseESSuccessfully(
				"""
						YUI.add("app-transitions",function(e,t){function n(){}n.ATTRS={transitions:{setter:"_setTransitions",value:!1}},n.FX={fade:{viewIn:"app:fadeIn",viewOut:"app:fadeOut"},slideLeft:{viewIn:"app:slideLeft",viewOut:"app:slideLeft"},slideRight:{viewIn:"app:slideRight",viewOut:"app:slideRight"}},n.prototype={transitions:{navigate:"fade",toChild:"slideLeft",toParent:"slideRight"},_setTransitions:function(t){var n=this.transitions;return t&&t===!0?e.merge(n):t}},e.App.Transitions=n,e.Base.mix(e.App,[n]),e.mix(e.App.CLASS_NAMES,{transitioning:e.ClassNameManager.getClassName("app","transitioning")})},"3.12.0",{requires:["app-base"]});
						""");
	}

	@Test
	public void testAutoCompleteSourcesMin() {
		parseESSuccessfully(
				"""
						YUI.add("autocomplete-sources",function(e,t){var n=e.AutoCompleteBase,r=e.Lang,i="_sourceSuccess",s="maxResults",o="requestTemplate",u="resultListLocator";e.mix(n.prototype,{_YQL_SOURCE_REGEX:/^(?:select|set|use)\\s+/i,_beforeCreateObjectSource:function(t){return t instanceof e.Node&&t.get("nodeName").toLowerCase()==="select"?this._createSelectSource(t):e.JSONPRequest&&t instanceof e.JSONPRequest?this._createJSONPSource(t):this._createObjectSource(t)},_createIOSource:function(t){function a(n){var o=n.request;if(r._cache&&o in r._cache){r[i](r._cache[o],n);return}s&&s.isInProgress()&&s.abort(),s=e.io(r._getXHRUrl(t,n),{on:{success:function(t,s){var u;try{u=e.JSON.parse(s.responseText)}catch(a){e.error("JSON parse error",a)}u&&(r._cache&&(r._cache[o]=u),r[i](u,n))}}})}var n={type:"io"},r=this,s,o,u;return n.sendRequest=function(t){o=t;if(u)return;u=!0,e.use("io-base","json-parse",function(){n.sendRequest=a,a(o)})},n},_createJSONPSource:function(t){function u(e){var n=e.request,s=e.query;if(r._cache&&n in r._cache){r[i](r._cache[n],e);return}t._config.on.success=function(t){r._cache&&(r._cache[n]=t),r[i](t,e)},t.send(s)}var n={type:"jsonp"},r=this,s,o;return n.sendRequest=function(i){s=i;if(o)return;o=!0,e.use("jsonp",function(){t instanceof e.JSONPRequest||(t=new e.JSONPRequest(t,{format:e.bind(r._jsonpFormatter,r)})),n.sendRequest=u,u(s)})},n},_createSelectSource:function(e){var t=this;return{type:"select",sendRequest:function(n){var r=[];e.get("options").each(function(e){r.push({html:e.get("innerHTML"),index:e.get("index"),node:e,selected:e.get("selected"),text:e.get("text"),value:e.get("value")})}),t[i](r,n)}}},_createStringSource:function(e){return this._YQL_SOURCE_REGEX.test(e)?this._createYQLSource(e):e.indexOf("{callback}")!==-1?this._createJSONPSource(e):this._createIOSource(e)},_createYQLSource:function(t){function c(o){var u=o.query,a=n.get("yqlEnv"),f=n.get(s),c,h,p;p=r.sub(t,{maxResults:f>0?f:1e3,request:o.request,query:u});if(n._cache&&p in n._cache){n[i](n._cache[p],o);return}c=function(e){n._cache&&(n._cache[p]=e),n[i](e,o)},h={proto:n.get("yqlProtocol")},l?(l._callback=c,l._opts=h,l._params.q=p,a&&(l._params.env=a)):l=new e.YQLRequest(p,{on:{success:c},allowCache:!1},a?{env:a}:null,h),l.send()}var n=this,o={type:"yql"},a,f,l;return n.get(u)||n.set(u,n._defaultYQLLocator),o.sendRequest=function(t){a=t,f||(f=!0,e.use("yql",function(){o.sendRequest=c,c(a)}))},o},_defaultYQLLocator:function(t){var n=t&&t.query&&t.query.results,i;return n&&r.isObject(n)?(i=e.Object.values(n)||[],n=i.length===1?i[0]:i,r.isArray(n)||(n=[n])):n=[],n},_getXHRUrl:function(e,t){var n=this.get(s);return t.query!==t.request&&(e+=t.request),r.sub(e,{maxResults:n>0?n:1e3,query:encodeURIComponent(t.query)})},_jsonpFormatter:function(e,t,n){var i=this.get(s),u=this.get(o);return u&&(e+=u(n)),r.sub(e,{callback:t,maxResults:i>0?i:1e3,query:encodeURIComponent(n)})}}),e.mix(n.ATTRS,{yqlEnv:{value:null},yqlProtocol:{value:"http"}}),e.mix(n.SOURCE_TYPES,{io:"_createIOSource",jsonp:"_createJSONPSource",object:"_beforeCreateObjectSource",select:"_createSelectSource",string:"_createStringSource",yql:"_createYQLSource"},!0)},"3.12.0",{optional:["io-base","json-parse","jsonp","yql"],requires:["autocomplete-base"]});
						""");
	}

	@Test
	public void testButtonPluginMin() {
		parseESSuccessfully(
				"""
						YUI.add("button-plugin",function(e,t){function n(){n.superclass.constructor.apply(this,arguments)}e.extend(n,e.ButtonCore,{_afterNodeGet:function(t){var n=this.constructor.ATTRS,r=n[t]&&n[t].getter&&this[n[t].getter];if(r)return new e.Do.AlterReturn("get "+t,r.call(this))},_afterNodeSet:function(e,t){var n=this.constructor.ATTRS,r=n[e]&&n[e].setter&&this[n[e].setter];r&&r.call(this,t)},_initNode:function(t){var n=t.host;this._host=n,e.Do.after(this._afterNodeGet,n,"get",this),e.Do.after(this._afterNodeSet,n,"set",this)},destroy:function(){}},{ATTRS:e.merge(e.ButtonCore.ATTRS),NAME:"buttonPlugin",NS:"button"}),n.createNode=function(t,n){var r;return t&&!n&&!t.nodeType&&!t.getDOMNode&&typeof t!="string"&&(n=t,t=n.srcNode),n=n||{},r=n.template||e.Plugin.Button.prototype.TEMPLATE,t=t||n.srcNode||e.DOM.create(r),e.one(t).plug(e.Plugin.Button,n)},e.namespace("Plugin").Button=n},"3.12.0",{requires:["button-core","cssbutton","node-pluginhost"]});
						""");
	}

	@Test
	public void testViewMin() {
		parseESSuccessfully(
				"""
						YUI.add("view",function(e,t){function n(){n.superclass.constructor.apply(this,arguments)}e.View=e.extend(n,e.Base,{containerTemplate:"<div/>",events:{},template:"",_allowAdHocAttrs:!0,initializer:function(t){t||(t={}),t.containerTemplate&&(this.containerTemplate=t.containerTemplate),t.template&&(this.template=t.template),this.events=t.events?e.merge(this.events,t.events):this.events,this.after("containerChange",this._afterContainerChange)},destroy:function(e){return e&&(e.remove||e["delete"])&&this.onceAfter("destroy",function(){this._destroyContainer()}),n.superclass.destroy.call(this)},destructor:function(){this.detachEvents(),delete this._container},attachEvents:function(t){var n=this.get("container"),r=e.Object.owns,i,s,o,u;this.detachEvents(),t||(t=this.events);for(u in t){if(!r(t,u))continue;s=t[u];for(o in s){if(!r(s,o))continue;i=s[o],typeof i=="string"&&(i=this[i]);if(!i)continue;this._attachedViewEvents.push(n.delegate(o,i,u,this))}}return this},create:function(t){return t?e.one(t):e.Node.create(this.containerTemplate)},detachEvents:function(){return e.Array.each(this._attachedViewEvents,function(e){e&&e.detach()}),this._attachedViewEvents=[],this},remove:function(){var e=this.get("container");return e&&e.remove(),this},render:function(){return this},_destroyContainer:function(){var e=this.get("container");e&&e.remove(!0)},_getContainer:function(e){return this._container||(e?(this._container=e,this.attachEvents()):(e=this._container=this.create(),this._set("container",e))),e},_afterContainerChange:function(){this.attachEvents(this.events)}},{NAME:"view",ATTRS:{container:{getter:"_getContainer",setter:e.one,writeOnce:!0}},_NON_ATTRS_CFG:["containerTemplate","events","template"]})},"3.12.0",{requires:["base-build","node-event-delegate"]});
						""");
	}

	@Test
	public void testZeroEscape() {
		parseESSuccessfully("""
				"use strict";
				'\\0'
				""");
	}

	@Test
	public void testCommaExpressionWithBinaryOperations() {
		parseESSuccessfully("""
				e=+e,e!==e?e=0:e!==0&&e!==1/0&&e!==-1/0&&(e=(e>0||-1)*Math.floor(Math.abs(e))),e
				""");
	}

	@Test
	public void testRegEx_01() {
		parseESSuccessfully("""
				replace(/[^\\/]+\\/\\.\\.\\//)
					""");
	}

	@Test
	public void testRegEx_02() {
		parseESSuccessfully("""
				var e=/^/g;
				""");
	}

	@Test
	public void testRegEx_03() {
		parseESSuccessfully("""
				if(true){}/[^\\s]/.test(a)
				""");
	}

	@Test
	public void testRegEx_04() {
		parseESSuccessfully("""
				{if(true){}}/[^\\s]/.test(a)
				""");
	}

	@Test
	public void testRegEx_05() {
		parseESSuccessfully("""
				{if(true){}/[^\\s]/.test(a)}
				""");
	}

	@Test
	public void testRegEx_06() {
		parseESSuccessfully("""
				if(true){({})/s}
				""");
	}

	@Test
	public void testRegEx_07() {
		parseESSuccessfully("""
				if(true){({}/s)}
				""");
	}

	@Test
	public void testRegEx_08() {
		parseESSuccessfully("""
				if ({} / 1 !== 1) {}
				""");
	}

	@Test
	public void testRegEx_09() {
		parseESSuccessfully("""
				isNaN(function(){return 1} / {}) !== true
				""");
	}

	@Test
	public void testRegEx_10() {
		parseESSuccessfully("""
				if ((x = 1) / x !== 1) {}
				""");
	}

	@Test
	public void testRegEx_11() {
		parseESSuccessfully("""
				if (isNaN({} / function(){return 1}) !== true) {}
				""");
	}

	@Test
	public void testRegEx_12() {
		parseESSuccessfully("""
				if(true){if(true)b}/[^\\s]/.test(a)
				""");
	}

	@Test
	public void testRegEx_13() {
		parseESSuccessfully("""
				if (isNaN(function(){return 1} / {}) !== true) {}
				""");
	}

	@Test
	public void testRegEx_14() {
		parseESSuccessfully("""
				if (true)/a/.test(a)
				""");
	}

	@Test
	public void testBinaryOp_01() {
		parseESSuccessfully("""
				x0() / y0()
				""");
	}

}
